blob: f624343138d6bd569df873d7079be21c08e84b80 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Simon Glass3d355e62015-07-06 12:54:31 -06002/*
3 * Copyright (C) 2015 Google, Inc
Simon Glass3d355e62015-07-06 12:54:31 -06004 */
5
6#include <common.h>
7#include <dm.h>
8#include <ram.h>
Simon Glass3ba929a2020-10-30 21:38:53 -06009#include <asm/global_data.h>
Simon Glass3d355e62015-07-06 12:54:31 -060010#include <dm/test.h>
Simon Glass75c4d412020-07-19 10:15:37 -060011#include <test/test.h>
Simon Glass3d355e62015-07-06 12:54:31 -060012#include <test/ut.h>
13
14DECLARE_GLOBAL_DATA_PTR;
15
16/* Basic test of the ram uclass */
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}
Simon Glass974dccd2020-07-28 19:41:12 -060029DM_TEST(dm_test_ram_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);