ram.c 584 B

123456789101112131415161718192021222324252627
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (C) 2015 Google, Inc
  4. */
  5. #include <common.h>
  6. #include <dm.h>
  7. #include <ram.h>
  8. #include <dm/test.h>
  9. #include <test/ut.h>
  10. DECLARE_GLOBAL_DATA_PTR;
  11. /* Basic test of the ram uclass */
  12. static int dm_test_ram_base(struct unit_test_state *uts)
  13. {
  14. struct udevice *dev;
  15. struct ram_info info;
  16. ut_assertok(uclass_get_device(UCLASS_RAM, 0, &dev));
  17. ut_assertok(ram_get_info(dev, &info));
  18. ut_asserteq(0, info.base);
  19. ut_asserteq(gd->ram_size, info.size);
  20. return 0;
  21. }
  22. DM_TEST(dm_test_ram_base, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);