All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jagan Teki <jagan@amarulasolutions.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 08/13] test/dm: reset: Add reset_get_by_index[_nodev] test
Date: Thu, 28 Feb 2019 00:26:56 +0530	[thread overview]
Message-ID: <20190227185701.15545-9-jagan@amarulasolutions.com> (raw)
In-Reply-To: <20190227185701.15545-1-jagan@amarulasolutions.com>

Add sample dm reset test for reset_get_by_index and
reset_get_by_index_nodev functionality code.

Cc: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
 test/dm/reset.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/test/dm/reset.c b/test/dm/reset.c
index c02866a2f0..c61daed490 100644
--- a/test/dm/reset.c
+++ b/test/dm/reset.c
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <reset.h>
 #include <dm/test.h>
 #include <asm/reset.h>
 #include <test/ut.h>
@@ -15,6 +16,28 @@
 /* This is the other reset phandle specifier handled by bulk */
 #define OTHER_RESET_ID 2
 
+/* Base test of the reset uclass */
+static int dm_test_reset_base(struct unit_test_state *uts)
+{
+	struct udevice *dev;
+	struct reset_ctl reset_method1;
+	struct reset_ctl reset_method2;
+
+	/* Get the device using the reset device */
+	ut_assertok(uclass_get_device_by_name(UCLASS_MISC, "reset-ctl-test",
+					      &dev));
+
+	/* Get the same reset port in 2 different ways and compare */
+	ut_assertok(reset_get_by_index(dev, 1, &reset_method1));
+	ut_assertok(reset_get_by_index_nodev(dev_ofnode(dev), 1,
+					     &reset_method2));
+	ut_asserteq(reset_method1.id, reset_method2.id);
+
+	return 0;
+}
+
+DM_TEST(dm_test_reset_base, DM_TESTF_SCAN_FDT);
+
 static int dm_test_reset(struct unit_test_state *uts)
 {
 	struct udevice *dev_reset;
-- 
2.18.0.321.gffc6fa0e3

  parent reply	other threads:[~2019-02-27 18:56 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-27 18:56 [U-Boot] [PATCH v3 00/13] net: Add Allwinner EMAC CLK, RESET support Jagan Teki
2019-02-27 18:56 ` [U-Boot] [PATCH v3 01/13] clk: sunxi: Implement A10 EMAC clocks Jagan Teki
2019-02-27 18:56 ` [U-Boot] [PATCH v3 02/13] net: sunxi_emac: Add CLK support Jagan Teki
2019-03-01 18:59   ` Joe Hershberger
2019-02-27 18:56 ` [U-Boot] [PATCH v3 03/13] net: sun8i_emac: Retrieve GMAC clock via 'syscon' phandle Jagan Teki
2019-03-01 18:59   ` Joe Hershberger
2019-03-05 16:16     ` Jagan Teki
2019-03-05 17:25       ` Joe Hershberger
2019-03-07 16:22         ` Jagan Teki
2019-03-07 17:49           ` Joe Hershberger
2019-02-27 18:56 ` [U-Boot] [PATCH v3 04/13] clk: Get the CLK by index without device Jagan Teki
2019-02-27 18:56 ` [U-Boot] [PATCH v3 05/13] clk: Use clk_get_by_index_tail() Jagan Teki
2019-03-10 21:51   ` Simon Glass
2019-02-27 18:56 ` [U-Boot] [PATCH v3 06/13] test/dm: clk: Add clk_get_by_index[_nodev] test Jagan Teki
2019-02-27 18:56 ` [U-Boot] [PATCH v3 07/13] reset: Get the RESET by index without device Jagan Teki
2019-02-27 18:56 ` Jagan Teki [this message]
2019-02-27 18:56 ` [U-Boot] [PATCH v3 09/13] clk: sunxi: Implement EMAC, GMAC clocks, resets Jagan Teki
2019-03-01 19:00   ` Joe Hershberger
2019-02-27 18:56 ` [U-Boot] [PATCH v3 10/13] net: sun8i_emac: Add CLK and RESET support Jagan Teki
2019-03-01 21:17   ` Joe Hershberger
2019-02-27 18:56 ` [U-Boot] [PATCH v3 11/13] clk: sunxi: h3: Implement EPHY CLK and RESET Jagan Teki
2019-03-01 21:12   ` Joe Hershberger
2019-02-27 18:57 ` [U-Boot] [PATCH v3 12/13] net: sun8i_emac: Add EPHY CLK and RESET support Jagan Teki
2019-03-01 21:29   ` Joe Hershberger
2019-02-27 18:57 ` [U-Boot] [PATCH v3 13/13] board: sunxi: gmac: Remove Ethernet clock and reset Jagan Teki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190227185701.15545-9-jagan@amarulasolutions.com \
    --to=jagan@amarulasolutions.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.