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