ram.c 636 B

1234567891011121314151617181920212223242526272829
  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 <asm/global_data.h>
  9. #include <dm/test.h>
  10. #include <test/test.h>
  11. #include <test/ut.h>
  12. DECLARE_GLOBAL_DATA_PTR;
  13. /* Basic test of the ram uclass */
  14. static int dm_test_ram_base(struct unit_test_state *uts)
  15. {
  16. struct udevice *dev;
  17. struct ram_info info;
  18. ut_assertok(uclass_get_device(UCLASS_RAM, 0, &dev));
  19. ut_assertok(ram_get_info(dev, &info));
  20. ut_asserteq(0, info.base);
  21. ut_asserteq(gd->ram_size, info.size);
  22. return 0;
  23. }
  24. DM_TEST(dm_test_ram_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);