blob: 67e22d76c930d56c398c872dc93434b8c497930d [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Simon Glass6c51df62015-06-23 15:39:04 -06002/*
3 * Copyright (c) 2015 Google, Inc
4 * Written by Simon Glass <sjg@chromium.org>
Simon Glass6c51df62015-06-23 15:39:04 -06005 */
6
7#ifndef __RAM_H
8#define __RAM_H
9
10struct ram_info {
11 phys_addr_t base;
12 size_t size;
13};
14
15struct ram_ops {
16 /**
17 * get_info() - Get basic memory info
18 *
19 * @dev: Device to check (UCLASS_RAM)
20 * @info: Place to put info
21 * @return 0 if OK, -ve on error
22 */
23 int (*get_info)(struct udevice *dev, struct ram_info *info);
24};
25
26#define ram_get_ops(dev) ((struct ram_ops *)(dev)->driver->ops)
27
28/**
29 * ram_get_info() - Get information about a RAM device
30 *
31 * @dev: Device to check (UCLASS_RAM)
32 * @info: Returns RAM info
33 * @return 0 if OK, -ve on error
34 */
35int ram_get_info(struct udevice *dev, struct ram_info *info);
36
37#endif