Resguardo inicial

This commit is contained in:
lastdragon
2026-09-06 12:53:21 -06:00
parent 662efe3c2a
commit ad2088d178
94853 changed files with 43200404 additions and 0 deletions
@@ -0,0 +1,106 @@
# SPDX-License-Identifier: GPL-2.0
obj-y += testcases.dtbo.o
obj-$(CONFIG_OF_OVERLAY) += overlay.dtbo.o \
overlay_0.dtbo.o \
overlay_1.dtbo.o \
overlay_2.dtbo.o \
overlay_3.dtbo.o \
overlay_4.dtbo.o \
overlay_5.dtbo.o \
overlay_6.dtbo.o \
overlay_7.dtbo.o \
overlay_8.dtbo.o \
overlay_9.dtbo.o \
overlay_10.dtbo.o \
overlay_11.dtbo.o \
overlay_12.dtbo.o \
overlay_13.dtbo.o \
overlay_15.dtbo.o \
overlay_16.dtbo.o \
overlay_17.dtbo.o \
overlay_18.dtbo.o \
overlay_19.dtbo.o \
overlay_20.dtbo.o \
overlay_bad_add_dup_node.dtbo.o \
overlay_bad_add_dup_prop.dtbo.o \
overlay_bad_phandle.dtbo.o \
overlay_bad_symbol.dtbo.o \
overlay_base.dtbo.o \
overlay_gpio_01.dtbo.o \
overlay_gpio_02a.dtbo.o \
overlay_gpio_02b.dtbo.o \
overlay_gpio_03.dtbo.o \
overlay_gpio_04a.dtbo.o \
overlay_gpio_04b.dtbo.o \
overlay_pci_node.dtbo.o \
overlay_bad_unresolved.dtbo.o
# enable creation of __symbols__ node
DTC_FLAGS_overlay += -@
DTC_FLAGS_overlay_bad_phandle += -@
DTC_FLAGS_overlay_bad_symbol += -@
DTC_FLAGS_overlay_base += -@
DTC_FLAGS_testcases += -@
# suppress warnings about intentional errors
DTC_FLAGS_testcases += -Wno-interrupts_property \
-Wno-node_name_vs_property_name \
-Wno-interrupt_map
# Apply overlays statically with fdtoverlay. This is a build time test that
# the overlays can be applied successfully by fdtoverlay. This does not
# guarantee that the overlays can be applied successfully at run time by
# unittest, but it provides a bit of build time test coverage for those
# who do not execute unittest.
#
# The overlays are applied on top of static_base_1.dtb and static_base_2.dtb to
# create static_test_1.dtb and static_test_2.dtb. If fdtoverlay detects an
# error than the kernel build will fail. static_test_1.dtb and
# static_test_2.dtb are not consumed by unittest.
#
# Some unittest overlays deliberately contain errors that unittest checks for.
# These overlays will cause fdtoverlay to fail, and are thus not included
# in the static test:
# overlay_bad_add_dup_node.dtbo \
# overlay_bad_add_dup_prop.dtbo \
# overlay_bad_phandle.dtbo \
# overlay_bad_symbol.dtbo \
apply_static_overlay_1 := overlay_0.dtbo \
overlay_1.dtbo \
overlay_2.dtbo \
overlay_3.dtbo \
overlay_4.dtbo \
overlay_5.dtbo \
overlay_6.dtbo \
overlay_7.dtbo \
overlay_8.dtbo \
overlay_9.dtbo \
overlay_10.dtbo \
overlay_11.dtbo \
overlay_12.dtbo \
overlay_13.dtbo \
overlay_15.dtbo \
overlay_16.dtbo \
overlay_17.dtbo \
overlay_18.dtbo \
overlay_19.dtbo \
overlay_20.dtbo \
overlay_gpio_01.dtbo \
overlay_gpio_02a.dtbo \
overlay_gpio_02b.dtbo \
overlay_gpio_03.dtbo \
overlay_gpio_04a.dtbo \
overlay_gpio_04b.dtbo
apply_static_overlay_2 := overlay.dtbo
DTC_FLAGS_static_base_1 += -Wno-interrupts_property \
-Wno-node_name_vs_property_name \
-Wno-interrupt_map
static_test_1-dtbs := static_base_1.dtb $(apply_static_overlay_1)
static_test_2-dtbs := static_base_2.dtb $(apply_static_overlay_2)
dtb-$(CONFIG_OF_OVERLAY) += static_test_1.dtb static_test_2.dtb
@@ -0,0 +1,62 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
&electric_1 {
status = "okay";
hvac_2: hvac-large-1 {
compatible = "ot,hvac-large";
heat-range = <40 75>;
cool-range = <65 80>;
};
};
&rides_1 {
#address-cells = <1>;
#size-cells = <1>;
status = "okay";
ride@100 {
#address-cells = <1>;
#size-cells = <1>;
track@30 {
incline-up = <48 32 16>;
};
track@40 {
incline-up = <47 31 15>;
};
};
ride_200: ride@200 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "ot,ferris-wheel";
reg = <0x00000200 0x100>;
hvac-provider = <&hvac_2>;
hvac-thermostat = <27 32> ;
hvac-zones = <12 5>;
hvac-zone-names = "operator", "snack-bar";
spin-controller = <&spin_ctrl_1 3>;
spin-rph = <30>;
gondolas = <16>;
gondola-capacity = <6>;
ride_200_left: track@10 {
reg = <0x00000010 0x10>;
};
ride_200_right: track@20 {
reg = <0x00000020 0x10>;
};
};
};
&lights_2 {
status = "okay";
color = "purple", "white", "red", "green";
rate = <3 256>;
};
@@ -0,0 +1,9 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
/* overlay_0 - enable using absolute target path */
&{/testcase-data/overlay-node/test-bus/test-unittest0} {
status = "okay";
};
@@ -0,0 +1,9 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
/* overlay_1 - disable using absolute target path */
&{/testcase-data/overlay-node/test-bus/test-unittest1} {
status = "disabled";
};
@@ -0,0 +1,27 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
/* overlay_10 */
/* overlays 8, 9, 10, 11 application and removal in bad sequence */
&unittest_test_bus {
/* suppress DTC warning */
#address-cells = <1>;
#size-cells = <0>;
test-unittest10 {
compatible = "unittest";
status = "okay";
reg = <10>;
#address-cells = <1>;
#size-cells = <0>;
test-unittest101 {
compatible = "unittest";
status = "okay";
reg = <1>;
};
};
};
@@ -0,0 +1,27 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
/* overlay_11 */
/* overlays 8, 9, 10, 11 application and removal in bad sequence */
&unittest_test_bus {
/* suppress DTC warning */
#address-cells = <1>;
#size-cells = <0>;
test-unittest11 {
compatible = "unittest";
status = "okay";
reg = <11>;
#address-cells = <1>;
#size-cells = <0>;
test-unittest111 {
compatible = "unittest";
status = "okay";
reg = <1>;
};
};
};
@@ -0,0 +1,9 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
/* overlay_12 - enable using absolute target path (i2c) */
&{/testcase-data/overlay-node/test-bus/i2c-test-bus/test-unittest12} {
status = "okay";
};
@@ -0,0 +1,9 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
/* overlay_13 - disable using absolute target path (i2c) */
&{/testcase-data/overlay-node/test-bus/i2c-test-bus/test-unittest13} {
status = "disabled";
};
@@ -0,0 +1,31 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
/* overlay_15 - mux overlay */
&unittest_i2c_test_bus {
#address-cells = <1>;
#size-cells = <0>;
test-unittest15 {
reg = <11>;
compatible = "unittest-i2c-mux";
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
i2c@0 {
#address-cells = <1>;
#size-cells = <0>;
reg = <0>;
test-mux-dev@20 {
reg = <0x20>;
compatible = "unittest-i2c-dev";
status = "okay";
};
};
};
};
@@ -0,0 +1,15 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
/* overlay_16 - notify test */
&unittest_test_bus {
#address-cells = <1>;
#size-cells = <0>;
test-unittest16 {
compatible = "unittest";
reg = <16>;
};
};
@@ -0,0 +1,15 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
/* overlay_17 - notify test */
&unittest_test_bus {
#address-cells = <1>;
#size-cells = <0>;
test-unittest17 {
compatible = "unittest";
reg = <17>;
};
};
@@ -0,0 +1,15 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
/* overlay_18 - notify test */
&unittest_test_bus {
#address-cells = <1>;
#size-cells = <0>;
test-unittest18 {
compatible = "unittest";
reg = <18>;
};
};
@@ -0,0 +1,15 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
/* overlay_19 - notify test */
&unittest_test_bus {
#address-cells = <1>;
#size-cells = <0>;
test-unittest19 {
compatible = "unittest";
reg = <19>;
};
};
@@ -0,0 +1,9 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
/* overlay_2 - enable using label */
&unittest2 {
status = "okay";
};
@@ -0,0 +1,15 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
/* overlay_20 - notify test */
&unittest_test_bus {
#address-cells = <1>;
#size-cells = <0>;
test-unittest20 {
compatible = "unittest";
reg = <20>;
};
};
@@ -0,0 +1,9 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
/* overlay_3 - disable using label */
&unittest3 {
status = "disabled";
};
@@ -0,0 +1,17 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
/* overlay_4 - test insertion of a full node */
&unittest_test_bus {
/* suppress DTC warning */
#address-cells = <1>;
#size-cells = <0>;
test-unittest4 {
compatible = "unittest";
status = "okay";
reg = <4>;
};
};
@@ -0,0 +1,9 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
/* overlay_5 - test overlay apply revert */
&unittest5 {
status = "okay";
};
@@ -0,0 +1,10 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
/* overlay_6 */
/* overlays 6, 7 application and removal in sequence */
&unittest6 {
status = "okay";
};
@@ -0,0 +1,10 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
/* overlay_7 */
/* overlays 6, 7 application and removal in sequence */
&unittest7 {
status = "okay";
};
@@ -0,0 +1,10 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
/* overlay_8 */
/* overlays 8, 9, 10, 11 application and removal in bad sequence */
&unittest8 {
status = "okay";
};
@@ -0,0 +1,10 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
/* overlay_9 */
/* overlays 8, 9, 10, 11 application and removal in bad sequence */
&unittest8 {
property-foo = "bar";
};
@@ -0,0 +1,27 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
/*
* &electric_1/motor-1 and &spin_ctrl_1 are the same node:
* /testcase-data-2/substation@100/motor-1
*
* Thus the new node "controller" in each fragment will
* result in an attempt to add the same node twice.
* This will result in an error and the overlay apply
* will fail.
*/
&electric_1 {
motor-1 {
controller {
power_bus = <0x1 0x2>;
};
};
};
&spin_ctrl_1 {
controller {
power_bus_emergency = <0x101 0x102>;
};
};
@@ -0,0 +1,38 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
/*
* &electric_1/motor-1/electric and &spin_ctrl_1/electric are the same node:
* /testcase-data-2/substation@100/motor-1/electric
*
* Thus the property "rpm_avail" in each fragment will
* result in an attempt to update the same property twice.
* This will result in an error and the overlay apply
* will fail.
*
* The previous version of this test did not include the extra
* level of node 'electric'. That resulted in the 'rpm_avail'
* property being located in the pre-existing node 'motor-1'.
* Modifying a property results in a WARNING that a memory leak
* will occur if the overlay is removed. Since the overlay apply
* fails, the memory leak does actually occur, and kmemleak will
* further report the memory leak if CONFIG_DEBUG_KMEMLEAK is
* enabled. Adding the overlay node 'electric' avoids the
* memory leak and thus people who use kmemleak will not
* have to debug this non-problem again.
*/
&electric_1 {
motor-1 {
electric {
rpm_avail = <100>;
};
};
};
&spin_ctrl_1 {
electric {
rpm_avail = <100 200>;
};
};
@@ -0,0 +1,13 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
&electric_1 {
// This label should cause an error when the overlay
// is applied. There is already a phandle value
// in the base tree for motor-1.
spin_ctrl_1_conflict: motor-1 {
accelerate = <3>;
decelerate = <5>;
};
};
@@ -0,0 +1,15 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
&electric_1 {
// This label should cause an error when the overlay
// is applied. There is already a symbol hvac_1
// in the base tree
hvac_1: hvac-medium-2 {
compatible = "ot,hvac-medium";
heat-range = <50 75>;
cool-range = <60 80>;
};
};
@@ -0,0 +1,7 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
&this_label_does_not_exist {
status = "okay";
};
@@ -0,0 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
#include "overlay_common.dtsi"
@@ -0,0 +1,89 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Base device tree that overlays will be applied against.
*
* Do not add any properties in node "/".
* Do not add any nodes other than "/testcase-data-2" in node "/".
* Do not add anything that would result in dtc creating node "/__fixups__".
* dtc will create nodes "/__symbols__" and "/__local_fixups__".
*/
/ {
testcase-data-2 {
#address-cells = <1>;
#size-cells = <1>;
electric_1: substation@100 {
compatible = "ot,big-volts-control";
reg = <0x00000100 0x100>;
status = "disabled";
hvac_1: hvac-medium-1 {
compatible = "ot,hvac-medium";
heat-range = <50 75>;
cool-range = <60 80>;
};
spin_ctrl_1: motor-1 {
compatible = "ot,ferris-wheel-motor";
spin = "clockwise";
rpm_avail = <50>;
};
spin_ctrl_2: motor-8 {
compatible = "ot,roller-coaster-motor";
};
};
rides_1: fairway-1 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "ot,rides";
status = "disabled";
orientation = <127>;
ride@100 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "ot,roller-coaster";
reg = <0x00000100 0x100>;
hvac-provider = <&hvac_1>;
hvac-thermostat = <29> ;
hvac-zones = <14>;
hvac-zone-names = "operator";
spin-controller = <&spin_ctrl_2 5 &spin_ctrl_2 7>;
spin-controller-names = "track_1", "track_2";
queues = <2>;
track@30 {
reg = <0x00000030 0x10>;
};
track@40 {
reg = <0x00000040 0x10>;
};
};
};
lights_1: lights@30000 {
compatible = "ot,work-lights";
reg = <0x00030000 0x1000>;
status = "disabled";
};
lights_2: lights@40000 {
compatible = "ot,show-lights";
reg = <0x00040000 0x1000>;
status = "disabled";
rate = <13 138>;
};
retail_1: vending@50000 {
reg = <0x00050000 0x1000>;
compatible = "ot,tickets";
status = "disabled";
};
};
};
@@ -0,0 +1,24 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
&unittest_test_bus {
#address-cells = <1>;
#size-cells = <0>;
gpio@0 {
compatible = "unittest-gpio";
reg = <0>;
gpio-controller;
#gpio-cells = <2>;
ngpios = <2>;
gpio-line-names = "line-A", "line-B";
line-b {
gpio-hog;
gpios = <2 0>;
input;
line-name = "line-B-input";
};
};
};
@@ -0,0 +1,17 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
&unittest_test_bus {
#address-cells = <1>;
#size-cells = <0>;
gpio@2 {
compatible = "unittest-gpio";
reg = <2>;
gpio-controller;
#gpio-cells = <2>;
ngpios = <2>;
gpio-line-names = "line-A", "line-B";
};
};
@@ -0,0 +1,17 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
&unittest_test_bus {
#address-cells = <1>;
#size-cells = <0>;
gpio@2 {
line-a {
gpio-hog;
gpios = <1 0>;
input;
line-name = "line-A-input";
};
};
};
@@ -0,0 +1,24 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
&unittest_test_bus {
#address-cells = <1>;
#size-cells = <0>;
gpio@3 {
compatible = "unittest-gpio";
reg = <3>;
gpio-controller;
#gpio-cells = <2>;
ngpios = <2>;
gpio-line-names = "line-A", "line-B", "line-C", "line-D";
line-d {
gpio-hog;
gpios = <4 0>;
input;
line-name = "line-D-input";
};
};
};
@@ -0,0 +1,17 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
&unittest_test_bus {
#address-cells = <1>;
#size-cells = <0>;
gpio@4 {
compatible = "unittest-gpio";
reg = <4>;
gpio-controller;
#gpio-cells = <2>;
ngpios = <2>;
gpio-line-names = "line-A", "line-B", "line-C", "line-D";
};
};
@@ -0,0 +1,17 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
&unittest_test_bus {
#address-cells = <1>;
#size-cells = <0>;
gpio@4 {
line-c {
gpio-hog;
gpios = <3 0>;
input;
line-name = "line-C-input";
};
};
};
@@ -0,0 +1,22 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/ {
fragment@0 {
target-path="";
__overlay__ {
#address-cells = <3>;
#size-cells = <2>;
pci-ep-bus@0 {
compatible = "simple-bus";
#address-cells = <1>;
#size-cells = <1>;
ranges = <0x0 0x0 0x0 0x0 0x1000>;
reg = <0 0 0 0 0>;
unittest-pci@100 {
compatible = "unittest-pci";
reg = <0x100 0x200>;
};
};
};
};
};
@@ -0,0 +1,4 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
#include "testcases_common.dtsi"
@@ -0,0 +1,4 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
#include "overlay_common.dtsi"
@@ -0,0 +1,21 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
#include "testcases_common.dtsi"
/ {
/*
* testcase data that intentionally results in an error is located here
* instead of in testcases_common.dtsi so that the static overlay apply
* tests will not include the error.
*/
testcase-data {
testcase-device2 {
compatible = "testcase-device";
interrupt-parent = <&test_intc2>;
interrupts = <1>; /* invalid specifier - too short */
};
};
};
@@ -0,0 +1,21 @@
// SPDX-License-Identifier: GPL-2.0
/ {
testcase-data {
changeset {
prop-update = "hello";
prop-remove = "world";
node-remove {
};
};
};
};
#include "tests-phandle.dtsi"
#include "tests-interrupts.dtsi"
#include "tests-match.dtsi"
#include "tests-address.dtsi"
#include "tests-platform.dtsi"
#include "tests-overlay.dtsi"
#include "tests-lifecycle.dtsi"
@@ -0,0 +1,158 @@
// SPDX-License-Identifier: GPL-2.0
/ {
#address-cells = <1>;
#size-cells = <1>;
testcase-data {
#address-cells = <1>;
#size-cells = <1>;
ranges;
address-tests {
#address-cells = <1>;
#size-cells = <1>;
/* ranges here is to make sure we don't use it for
* dma-ranges translation */
ranges = <0x70000000 0x70000000 0x50000000>,
<0x00000000 0xd0000000 0x20000000>;
dma-ranges = <0x0 0x20000000 0x40000000>;
device@70000000 {
reg = <0x70000000 0x1000>;
};
bus@80000000 {
#address-cells = <2>;
#size-cells = <2>;
ranges = <0x0 0x0 0x80000000 0x0 0x100000>;
dma-ranges = <0x1 0x0 0x0 0x20 0x0>;
device@1000 {
reg = <0x0 0x1000 0x0 0x1000>;
};
};
pci@90000000 {
device_type = "pci";
#address-cells = <3>;
#size-cells = <2>;
reg = <0x90000000 0x1000>;
ranges = <0x42000000 0x0 0x40000000 0x40000000 0x0 0x10000000>;
dma-ranges = <0x42000000 0x0 0x80000000 0x00000000 0x0 0x10000000>,
<0x42000000 0x0 0xc0000000 0x20000000 0x0 0x10000000>;
};
bus@a0000000 {
#address-cells = <3>;
#size-cells = <2>;
ranges = <0xf00baa 0x0 0x0 0xa0000000 0x0 0x100000>,
<0xf00bee 0x1 0x0 0xb0000000 0x0 0x200000>;
};
};
address-tests2 {
#address-cells = <2>;
#size-cells = <1>;
ranges = <0x10000000 0x01000000 0xa0000000 0x01000000>,
<0x10000000 0x02000000 0xb0000000 0x01000000>,
<0x20000000 0x01000000 0xc0000000 0x01000000>,
<0x20000000 0x02000000 0xd0000000 0x01000000>,
<0x00000000 0xd1000000 0xd1000000 0x01000000>,
<0x00000000 0xe8000000 0xe8000000 0x07f00000>,
<0x00000000 0xefff0000 0xefff0000 0x00010000>;
bus-2cell@10000000 {
#address-cells = <2>;
#size-cells = <1>;
ranges = <0x100000 0x10000 0x10000000 0x1a00000 0x10000>,
<0x100000 0x20000 0x10000000 0x1b00000 0x10000>,
<0x200000 0x10000 0x20000000 0x1c00000 0x10000>,
<0x200000 0x20000 0x20000000 0x2d00000 0x10000>;
device@100000 {
reg = <0x100000 0x11000 0x100>,
<0x100000 0x12000 0x100>,
<0x200000 0x11000 0x100>,
<0x200000 0x21000 0x100>;
};
};
bus-3cell@20000000 {
#address-cells = <3>;
#size-cells = <1>;
ranges = <0x1 0x100000 0x10000 0x10000000 0x1a00000 0x10000>,
<0x2 0x100000 0x10000 0x10000000 0x1b00000 0x10000>,
<0x3 0x200000 0x10000 0x20000000 0x1c00000 0x10000>,
<0x4 0x200000 0x20000 0x20000000 0x2d00000 0x10000>;
local-bus@100000 {
#address-cells = <1>;
#size-cells = <1>;
ranges = <0xf1000000 0x1 0x100000 0x10000 0x10000>,
<0xf2000000 0x2 0x100000 0x10000 0x10000>,
<0xf3000000 0x3 0x200000 0x10000 0x08000>,
<0xf3800000 0x3 0x200000 0x18000 0x08000>,
<0xf4000000 0x4 0x200000 0x20000 0x10000>;
device@f1001000 {
reg = <0xf1001000 0x100>,
<0xf2002000 0x100>,
<0xf3001000 0x100>,
<0xf3801000 0x100>,
<0xf4001000 0x100>;
};
};
};
pcie@d1070000 {
#address-cells = <0x03>;
#size-cells = <0x02>;
bus-range = <0x00 0xff>;
device_type = "pci";
ranges = <0x82000000 0 0xe8000000 0 0xe8000000 0 0x7f00000>,
<0x81000000 0 0x00000000 0 0xefff0000 0 0x0010000>;
dma-ranges = <0x43000000 0x10 0x00 0x00 0x00 0x00 0x10000000>;
reg = <0x00000000 0xd1070000 0x20000>;
pci@0,0 {
#address-cells = <0x03>;
#size-cells = <0x02>;
bus-range = <0x01 0x01>;
device_type = "pci";
ranges = <0x82000000 0 0xe8000000
0x82000000 0 0xe8000000
0 0x4400000>;
reg = <0x00 0x00 0x00 0x00 0x00>;
dev@0,0 {
#address-cells = <0x03>;
#size-cells = <0x02>;
ranges = <0 0 0 0x82010000 0 0xe8000000 0 0x2000000>,
<1 0 0 0x82010000 0 0xea000000 0 0x1000000>,
<2 0 0 0x82010000 0 0xeb000000 0 0x0800000>,
<3 0 0 0x82010000 0 0xeb800000 0 0x0800000>,
<4 0 0 0x82010000 0 0xec000000 0 0x0020000>,
<5 0 0 0x82010000 0 0xec020000 0 0x0002000>;
reg = <0x10000 0x00 0x00 0x00 0x00>;
local-bus@0 {
#address-cells = <0x01>;
#size-cells = <0x01>;
ranges = <0xa0000000 0 0 0 0x2000000>,
<0xb0000000 1 0 0 0x1000000>;
dma-ranges = <0xc0000000 0x43000000 0x10 0x00 0x10000000>;
dev@e0000000 {
reg = <0xa0001000 0x1000>,
<0xb0002000 0x2000>;
};
};
};
};
};
};
};
};
@@ -0,0 +1,113 @@
// SPDX-License-Identifier: GPL-2.0
/ {
testcase-data {
interrupts {
#address-cells = <1>;
#size-cells = <1>;
test_intc0: intc0 {
interrupt-controller;
#interrupt-cells = <1>;
};
test_intc1: intc1 {
interrupt-controller;
#interrupt-cells = <3>;
};
test_intc2: intc2 {
interrupt-controller;
#interrupt-cells = <2>;
};
test_intmap0: intmap0 {
#interrupt-cells = <1>;
#address-cells = <0>;
interrupt-map = <1 &test_intc0 9>,
<2 &test_intc1 10 11 12>,
<3 &test_intc2 13 14>,
<4 &test_intc2 15 16>;
};
test_intmap1: intmap1 {
#interrupt-cells = <2>;
/*
* #address-cells is required
*
* The property is not provided in this node to
* test that the code will properly handle
* this case for legacy .dts files.
*
* Not having #address-cells will result in a
* warning from dtc starting with
* version v1.6.1-19-g0a3a9d3449c8
* The warning is suppressed by adding
* -Wno-interrupt_map to the Makefile for all
* .dts files this include this .dtsi
#address-cells = <1>;
*/
interrupt-map = <0x5000 1 2 &test_intc0 15>;
};
intmap2 {
#interrupt-cells = <2>;
#address-cells = <0>;
interrupt-map = <1 11 &test_intc0 100>,
<2 22 &test_intc1 200 201 202>,
<3 33 &test_intc2 300 301>,
<4 44 &test_intc2 400 401>;
};
test_intc_intmap0: intc-intmap0 {
#interrupt-cells = <1>;
#address-cells = <1>;
interrupt-controller;
interrupt-map = <0x6000 1 &test_intc_intmap0 0x7000 2>;
};
interrupts0 {
interrupt-parent = <&test_intc0>;
interrupts = <1>, <2>, <3>, <4>;
};
interrupts1 {
interrupt-parent = <&test_intmap0>;
interrupts = <1>, <2>, <3>, <4>;
};
interrupts2 {
reg = <0x6000 0x100>;
interrupt-parent = <&test_intc_intmap0>;
interrupts = <1>;
};
interrupts-extended0 {
reg = <0x5000 0x100>;
/*
* Do not remove &test_intmap1 from this
* property - see comment in node intmap1
*/
interrupts-extended = <&test_intc0 1>,
<&test_intc1 2 3 4>,
<&test_intc2 5 6>,
<&test_intmap0 1>,
<&test_intmap0 2>,
<&test_intmap0 3>,
<&test_intmap1 1 2>;
};
};
testcase-device1 {
compatible = "testcase-device";
interrupt-parent = <&test_intc0>;
interrupts = <1>;
};
/*
* testcase data that intentionally results in an error is
* located in testcases.dts instead of in this file so that the
* static overlay apply tests will not include the error.
*/
};
};
@@ -0,0 +1,8 @@
// SPDX-License-Identifier: GPL-2.0
/ {
testcase-data {
refcount-node {
};
};
};
@@ -0,0 +1,20 @@
// SPDX-License-Identifier: GPL-2.0
/ {
testcase-data {
match-node {
name0 { };
name1 { device_type = "type1"; };
a { name2 { device_type = "type1"; }; };
b { name2 { }; };
c { name2 { device_type = "type2"; }; };
name3 { compatible = "compat3"; };
name4 { compatible = "compat2", "compat3"; };
name5 { compatible = "compat2", "compat3"; };
name6 { compatible = "compat1", "compat2", "compat3"; };
name7 { compatible = "compat2"; device_type = "type1"; };
name8 { compatible = "compat2"; device_type = "type1"; };
name9 { compatible = "compat2"; };
};
};
};
@@ -0,0 +1,116 @@
// SPDX-License-Identifier: GPL-2.0
/ {
testcase-data {
overlay-node {
/* test bus */
unittest_test_bus: test-bus {
compatible = "simple-bus";
#address-cells = <1>;
#size-cells = <0>;
unittest100: test-unittest100 {
compatible = "unittest";
status = "okay";
reg = <100>;
};
unittest101: test-unittest101 {
compatible = "unittest";
status = "disabled";
reg = <101>;
};
unittest0: test-unittest0 {
compatible = "unittest";
status = "disabled";
reg = <0>;
};
unittest1: test-unittest1 {
compatible = "unittest";
status = "okay";
reg = <1>;
};
unittest2: test-unittest2 {
compatible = "unittest";
status = "disabled";
reg = <2>;
};
unittest3: test-unittest3 {
compatible = "unittest";
status = "okay";
reg = <3>;
};
unittest5: test-unittest5 {
compatible = "unittest";
status = "disabled";
reg = <5>;
};
unittest6: test-unittest6 {
compatible = "unittest";
status = "disabled";
reg = <6>;
};
unittest7: test-unittest7 {
compatible = "unittest";
status = "disabled";
reg = <7>;
};
unittest8: test-unittest8 {
compatible = "unittest";
status = "disabled";
reg = <8>;
};
unittest_i2c_test_bus: i2c-test-bus {
compatible = "unittest-i2c-bus";
status = "okay";
reg = <50>;
#address-cells = <1>;
#size-cells = <0>;
test-unittest12 {
reg = <8>;
compatible = "unittest-i2c-dev";
status = "disabled";
};
test-unittest13 {
reg = <9>;
compatible = "unittest-i2c-dev";
status = "okay";
};
test-unittest14 {
reg = <10>;
compatible = "unittest-i2c-mux";
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
i2c@0 {
#address-cells = <1>;
#size-cells = <0>;
reg = <0>;
test-mux-dev@20 {
reg = <0x20>;
compatible = "unittest-i2c-dev";
status = "okay";
};
};
};
};
};
};
};
};
@@ -0,0 +1,84 @@
// SPDX-License-Identifier: GPL-2.0
/ {
aliases {
testcase-alias = &testcase;
};
testcase: testcase-data {
security-password = "password";
duplicate-name = "duplicate";
duplicate-name { };
phandle-tests {
provider0: provider0 {
#phandle-cells = <0>;
};
provider1: provider1 {
#phandle-cells = <1>;
};
provider2: provider2 {
#phandle-cells = <2>;
};
provider3: provider3 {
#phandle-cells = <3>;
};
provider4: provider4 {
#phandle-cells = <2>;
phandle-map = <0 1 &provider1 3>,
<4 0 &provider0>,
<16 5 &provider3 3 5 0>,
<200 8 &provider2 23 6>,
<19 0 &provider2 15 0>,
<2 3 &provider3 2 5 3>;
phandle-map-mask = <0xff 0xf>;
phandle-map-pass-thru = <0x0 0xf0>;
};
provider5: provider5 {
#phandle-cells = <2>;
phandle-map = <2 7 &provider4 2 3>;
phandle-map-mask = <0xff 0xf>;
phandle-map-pass-thru = <0x0 0xf0>;
};
consumer-a {
phandle-list = <&provider1 1>,
<&provider2 2 0>,
<0>,
<&provider3 4 4 3>,
<&provider2 5 100>,
<&provider0>,
<&provider1 7>;
phandle-list-names = "first", "second", "third";
phandle-list-bad-phandle = <12345678 0 0>;
phandle-list-bad-args = <&provider2 1 0>,
<&provider3 0>;
empty-property;
string-property = "foobar";
unterminated-string = [40 41 42 43];
unterminated-string-list = "first", "second", [40 41 42 43];
};
consumer-b {
phandle-list = <&provider1 1>,
<&provider4 2 3>,
<0>,
<&provider4 4 0x100>,
<&provider4 0 0x61>,
<&provider0>,
<&provider4 19 0x20>,
<&provider5 2 7>;
phandle-list-bad-phandle = <12345678 0 0>;
phandle-list-bad-args = <&provider2 1 0>,
<&provider4 0>;
};
};
};
};
@@ -0,0 +1,66 @@
// SPDX-License-Identifier: GPL-2.0
/ {
testcase-data {
platform-tests {
#address-cells = <1>;
#size-cells = <0>;
test-device@0 {
compatible = "test-device";
reg = <0x0>;
#address-cells = <1>;
#size-cells = <0>;
dev@100 {
compatible = "test-sub-device";
reg = <0x100>;
};
};
test-device@1 {
compatible = "test-device";
reg = <0x1>;
#address-cells = <1>;
#size-cells = <0>;
dev@100 {
compatible = "test-sub-device",
"test-compat2",
"test-compat3";
reg = <0x100>;
};
};
test-device@2 {
compatible = "test,rust-device";
reg = <0x2>;
test,u32-prop = <0xdeadbeef>;
test,i16-array = /bits/ 16 <1 2 (-3) (-4)>;
ref_child_0: child-0 {
test,ref-arg = <&ref_child_1 0x20 0x32>;
};
ref_child_1: child-1 {
test,ref-arg = <&ref_child_0 0x10 0x64>;
};
};
};
platform-tests-2 {
// No #address-cells or #size-cells
node {
#address-cells = <1>;
#size-cells = <1>;
test-device@100 {
compatible = "test-sub-device";
reg = <0x100 1>;
};
};
};
};
};