blob: f3710b1f691e2e4d94b6d51cec5ffdcc2582c313 [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
Simon Glass3d355e62015-07-06 12:54:31 -06006#include <dm.h>
7#include <ram.h>
Simon Glass3ba929a2020-10-30 21:38:53 -06008#include <asm/global_data.h>
Simon Glass3d355e62015-07-06 12:54:31 -06009#include <dm/test.h>
Simon Glass75c4d412020-07-19 10:15:37 -060010#include <test/test.h>
Simon Glass3d355e62015-07-06 12:54:31 -060011#include <test/ut.h>
12
13DECLARE_GLOBAL_DATA_PTR;
14
15/* Basic test of the ram uclass */
16static 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 Glass1a92f832024-08-22 07:57:48 -060028DM_TEST(dm_test_ram_base, UTF_SCAN_PDATA | UTF_SCAN_FDT);