aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-12-23 08:11:18 -0700
committerSimon Glass <sjg@chromium.org>2021-01-05 12:24:40 -0700
commit079ac59586fa1e0c69020e74e4f16cbfdf82232d (patch)
tree843659b2cd2956374d40b34747d3374a4f7d6c69 /include
parent3f8760824e028f5710e3d8ec029c8cc9fade1729 (diff)
downloadu-boot-079ac59586fa1e0c69020e74e4f16cbfdf82232d.tar.gz
test: Move some test drivers into their own file
At present several test drivers are part of the test file itself. Some of these are useful for of-platdata tests. Separate them out so we can use them for other things also. A few adjustments are needed so this driver can build for sandbox_spl as well. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/dm/test.h18
-rw-r--r--include/test/test.h9
2 files changed, 27 insertions, 0 deletions
diff --git a/include/dm/test.h b/include/dm/test.h
index cbe1b57d95f..6ac6672cd6f 100644
--- a/include/dm/test.h
+++ b/include/dm/test.h
@@ -167,6 +167,24 @@ struct sandbox_sdl_plat {
int font_size;
};
+/**
+ * struct dm_test_parent_plat - Used to track state in bus tests
+ *
+ * @count:
+ * @bind_flag: Indicates that the child post-bind method was called
+ * @uclass_bind_flag: Also indicates that the child post-bind method was called
+ */
+struct dm_test_parent_plat {
+ int count;
+ int bind_flag;
+ int uclass_bind_flag;
+};
+
+enum {
+ TEST_FLAG_CHILD_PROBED = 10,
+ TEST_FLAG_CHILD_REMOVED = -7,
+};
+
/* Declare ping methods for the drivers */
int test_ping(struct udevice *dev, int pingval, int *pingret);
int testfdt_ping(struct udevice *dev, int pingval, int *pingret);
diff --git a/include/test/test.h b/include/test/test.h
index 03e29290bf4..3fdaa2b5e51 100644
--- a/include/test/test.h
+++ b/include/test/test.h
@@ -95,6 +95,15 @@ enum {
};
/**
+ * testbus_get_clear_removed() - Test function to obtain removed device
+ *
+ * This is used in testbus to find out which device was removed. Calling this
+ * function returns a pointer to the device and then clears it back to NULL, so
+ * that a future test can check it.
+ */
+struct udevice *testbus_get_clear_removed(void);
+
+/**
* dm_test_main() - Run driver model tests
*
* Run all the available driver model tests, or a selection