summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2016-06-17 09:43:59 -0600
committerSimon Glass <sjg@chromium.org>2016-06-19 17:05:55 -0600
commit4581b717b1bf0fb04e7d9fcaf3d4c23d357154ac (patch)
treed59cea67293deab951e1322d4ab8add35ed555de /arch
parent89c1e2da78f82a09685006291ce8bb44f635fa25 (diff)
downloadu-boot-imx-4581b717b1bf0fb04e7d9fcaf3d4c23d357154ac.zip
u-boot-imx-4581b717b1bf0fb04e7d9fcaf3d4c23d357154ac.tar.gz
u-boot-imx-4581b717b1bf0fb04e7d9fcaf3d4c23d357154ac.tar.bz2
reset: implement a reset test
This adds a sandbox reset implementation (provider), a test client device, instantiates them both from Sandbox's DT, and adds a DM test that excercises everything. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/sandbox/dts/test.dts11
-rw-r--r--arch/sandbox/include/asm/reset.h21
2 files changed, 32 insertions, 0 deletions
diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts
index 686c215..879b30e 100644
--- a/arch/sandbox/dts/test.dts
+++ b/arch/sandbox/dts/test.dts
@@ -259,6 +259,17 @@
compatible = "sandbox,reset";
};
+ resetc: reset-ctl {
+ compatible = "sandbox,reset-ctl";
+ #reset-cells = <1>;
+ };
+
+ reset-ctl-test {
+ compatible = "sandbox,reset-ctl-test";
+ resets = <&resetc 100>, <&resetc 2>;
+ reset-names = "other", "test";
+ };
+
rproc_1: rproc@1 {
compatible = "sandbox,test-processor";
remoteproc-name = "remoteproc-test-dev1";
diff --git a/arch/sandbox/include/asm/reset.h b/arch/sandbox/include/asm/reset.h
new file mode 100644
index 0000000..7146aa5
--- /dev/null
+++ b/arch/sandbox/include/asm/reset.h
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2016, NVIDIA CORPORATION.
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#ifndef __SANDBOX_RESET_H
+#define __SANDBOX_RESET_H
+
+#include <common.h>
+
+struct udevice;
+
+int sandbox_reset_query(struct udevice *dev, unsigned long id);
+
+int sandbox_reset_test_get(struct udevice *dev);
+int sandbox_reset_test_assert(struct udevice *dev);
+int sandbox_reset_test_deassert(struct udevice *dev);
+int sandbox_reset_test_free(struct udevice *dev);
+
+#endif