diff options
author | Tom Rini | 2018-12-05 15:06:24 -0500 |
---|---|---|
committer | Tom Rini | 2018-12-05 15:06:24 -0500 |
commit | 9450ab2ba8d720bd9f73bccc0af2e2b5a2c2aaf1 (patch) | |
tree | b0566746ed9a8dd261e61113c19cf0a234a6417b /test/dm | |
parent | a77a8fde7bb850178c2e4ad3db354b536114ea32 (diff) | |
parent | 08898e8b22d74a4511eadee9b06b11aab43e809c (diff) |
Merge branch 'master' of git://git.denx.de/u-boot-spi
- Various MTD fixes from Boris
- Zap various unused / legacy paths.
- pxa3xx NAND update from Miquel
Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'test/dm')
-rw-r--r-- | test/dm/regmap.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/dm/regmap.c b/test/dm/regmap.c index a8d7e6829ec..9a70c159ddb 100644 --- a/test/dm/regmap.c +++ b/test/dm/regmap.c @@ -144,3 +144,29 @@ static int dm_test_regmap_getset(struct unit_test_state *uts) } DM_TEST(dm_test_regmap_getset, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT); + +/* Read polling test */ +static int dm_test_regmap_poll(struct unit_test_state *uts) +{ + struct udevice *dev; + struct regmap *map; + uint reg; + unsigned long start; + + ut_assertok(uclass_get_device(UCLASS_SYSCON, 0, &dev)); + map = syscon_get_regmap(dev); + ut_assertok_ptr(map); + + start = get_timer(0); + + ut_asserteq(-ETIMEDOUT, + regmap_read_poll_timeout(map, 0, reg, + (reg == 0xcacafafa), + 1, 5 * CONFIG_SYS_HZ)); + + ut_assert(get_timer(start) > (5 * CONFIG_SYS_HZ)); + + return 0; +} + +DM_TEST(dm_test_regmap_poll, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT); |