diff options
author | Tom Rini <trini@konsulko.com> | 2020-02-11 10:58:41 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-02-11 10:58:41 -0500 |
commit | 9a8942b53d57149754e0dfc975e0d92d1afd4087 (patch) | |
tree | de55e5352f3a8a79c413c0b8cb533428e5476841 /test/dm/test-fdt.c | |
parent | ae347120eed8204b1fdf018ddf79131964e57016 (diff) | |
parent | 21d651fb29cf268b1a5f64d080e3d352ee32c87f (diff) | |
download | u-boot-9a8942b53d57149754e0dfc975e0d92d1afd4087.tar.gz |
Merge tag 'dm-pull-6feb20' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm
sandbox conversion to SDL2
TPM TEE driver
Various minor sandbox video enhancements
New driver model core utility functions
Diffstat (limited to 'test/dm/test-fdt.c')
-rw-r--r-- | test/dm/test-fdt.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/test/dm/test-fdt.c b/test/dm/test-fdt.c index 698ca0e7cf..75ae08081c 100644 --- a/test/dm/test-fdt.c +++ b/test/dm/test-fdt.c @@ -12,6 +12,7 @@ #include <dm/test.h> #include <dm/root.h> #include <dm/device-internal.h> +#include <dm/devres.h> #include <dm/uclass-internal.h> #include <dm/util.h> #include <dm/lists.h> @@ -914,3 +915,41 @@ static int dm_test_uclass_drvdata(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_uclass_drvdata, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT); + +/* Test device_first_child_ofdata_err(), etc. */ +static int dm_test_child_ofdata(struct unit_test_state *uts) +{ + struct udevice *bus, *dev; + int count; + + ut_assertok(uclass_first_device_err(UCLASS_TEST_BUS, &bus)); + count = 0; + device_foreach_child_ofdata_to_platdata(dev, bus) { + ut_assert(dev->flags & DM_FLAG_PLATDATA_VALID); + ut_assert(!(dev->flags & DM_FLAG_ACTIVATED)); + count++; + } + ut_asserteq(3, count); + + return 0; +} +DM_TEST(dm_test_child_ofdata, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT); + +/* Test device_first_child_err(), etc. */ +static int dm_test_first_child_probe(struct unit_test_state *uts) +{ + struct udevice *bus, *dev; + int count; + + ut_assertok(uclass_first_device_err(UCLASS_TEST_BUS, &bus)); + count = 0; + device_foreach_child_probe(dev, bus) { + ut_assert(dev->flags & DM_FLAG_PLATDATA_VALID); + ut_assert(dev->flags & DM_FLAG_ACTIVATED); + count++; + } + ut_asserteq(3, count); + + return 0; +} +DM_TEST(dm_test_first_child_probe, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT); |