Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Simon Glass | 3d355e6 | 2015-07-06 12:54:31 -0600 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2015 Google, Inc |
Simon Glass | 3d355e6 | 2015-07-06 12:54:31 -0600 | [diff] [blame] | 4 | */ |
| 5 | |
Simon Glass | 3d355e6 | 2015-07-06 12:54:31 -0600 | [diff] [blame] | 6 | #include <dm.h> |
| 7 | #include <ram.h> |
Simon Glass | 3ba929a | 2020-10-30 21:38:53 -0600 | [diff] [blame] | 8 | #include <asm/global_data.h> |
Simon Glass | 3d355e6 | 2015-07-06 12:54:31 -0600 | [diff] [blame] | 9 | #include <dm/test.h> |
Simon Glass | 75c4d41 | 2020-07-19 10:15:37 -0600 | [diff] [blame] | 10 | #include <test/test.h> |
Simon Glass | 3d355e6 | 2015-07-06 12:54:31 -0600 | [diff] [blame] | 11 | #include <test/ut.h> |
| 12 | |
| 13 | DECLARE_GLOBAL_DATA_PTR; |
| 14 | |
| 15 | /* Basic test of the ram uclass */ |
| 16 | static int dm_test_ram_base(struct unit_test_state *uts) |
| 17 | { |
| 18 | struct udevice *dev; |
| 19 | struct ram_info info; |
| 20 | |
| 21 | ut_assertok(uclass_get_device(UCLASS_RAM, 0, &dev)); |
| 22 | ut_assertok(ram_get_info(dev, &info)); |
| 23 | ut_asserteq(0, info.base); |
| 24 | ut_asserteq(gd->ram_size, info.size); |
| 25 | |
| 26 | return 0; |
| 27 | } |
Simon Glass | 974dccd | 2020-07-28 19:41:12 -0600 | [diff] [blame] | 28 | DM_TEST(dm_test_ram_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); |