timer.c 510 B

123456789101112131415161718192021222324
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (C) 2015 Thomas Chou <thomas@wytron.com.tw>
  4. */
  5. #include <common.h>
  6. #include <dm.h>
  7. #include <timer.h>
  8. #include <dm/test.h>
  9. #include <test/ut.h>
  10. /*
  11. * Basic test of the timer uclass.
  12. */
  13. static int dm_test_timer_base(struct unit_test_state *uts)
  14. {
  15. struct udevice *dev;
  16. ut_assertok(uclass_get_device(UCLASS_TIMER, 0, &dev));
  17. ut_asserteq(1000000, timer_get_rate(dev));
  18. return 0;
  19. }
  20. DM_TEST(dm_test_timer_base, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);