summaryrefslogtreecommitdiff
path: root/test/dm
diff options
context:
space:
mode:
authorJoe Hershberger <joe.hershberger@ni.com>2015-03-22 17:09:17 -0500
committerSimon Glass <sjg@chromium.org>2015-04-18 11:11:13 -0600
commit6536b9bb769fe764f4793a1b37a2619391bb2482 (patch)
treec37a0e61c47ef3be23ba0d6f9dadec73f6d21816 /test/dm
parente58780dcb7b8656ebc2dd6ba6d0da728bc65bf40 (diff)
downloadu-boot-imx-6536b9bb769fe764f4793a1b37a2619391bb2482.zip
u-boot-imx-6536b9bb769fe764f4793a1b37a2619391bb2482.tar.gz
u-boot-imx-6536b9bb769fe764f4793a1b37a2619391bb2482.tar.bz2
dm: eth: Add support for ethprime env var
The ethprime env var is used to indicate the starting device if none is specified in ethact. Also support aliases specified in the ethprime var. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test/dm')
-rw-r--r--test/dm/eth.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/dm/eth.c b/test/dm/eth.c
index 5688b71..96e3c46 100644
--- a/test/dm/eth.c
+++ b/test/dm/eth.c
@@ -60,3 +60,23 @@ static int dm_test_eth_alias(struct dm_test_state *dms)
return 0;
}
DM_TEST(dm_test_eth_alias, DM_TESTF_SCAN_FDT);
+
+static int dm_test_eth_prime(struct dm_test_state *dms)
+{
+ NetPingIP = string_to_ip("1.1.2.2");
+
+ /* Expected to be "eth@10003000" because of ethprime variable */
+ setenv("ethact", NULL);
+ setenv("ethprime", "eth5");
+ ut_assertok(NetLoop(PING));
+ ut_asserteq_str("eth@10003000", getenv("ethact"));
+
+ /* Expected to be "eth@10002000" because it is first */
+ setenv("ethact", NULL);
+ setenv("ethprime", NULL);
+ ut_assertok(NetLoop(PING));
+ ut_asserteq_str("eth@10002000", getenv("ethact"));
+
+ return 0;
+}
+DM_TEST(dm_test_eth_prime, DM_TESTF_SCAN_FDT);