blob: 2fc971df465a55783871ee02983343fab74acca8 [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
Simon Glass401d1c42020-10-30 21:38:53 -060010struct udevice;
11
Simon Glass6c51df62015-06-23 15:39:04 -060012struct ram_info {
13 phys_addr_t base;
14 size_t size;
15};
16
17struct ram_ops {
18 /**
19 * get_info() - Get basic memory info
20 *
21 * @dev: Device to check (UCLASS_RAM)
22 * @info: Place to put info
23 * @return 0 if OK, -ve on error
24 */
25 int (*get_info)(struct udevice *dev, struct ram_info *info);
26};
27
28#define ram_get_ops(dev) ((struct ram_ops *)(dev)->driver->ops)
29
30/**
31 * ram_get_info() - Get information about a RAM device
32 *
33 * @dev: Device to check (UCLASS_RAM)
34 * @info: Returns RAM info
Heinrich Schuchardt185f8122022-01-19 18:05:50 +010035 * Return: 0 if OK, -ve on error
Simon Glass6c51df62015-06-23 15:39:04 -060036 */
37int ram_get_info(struct udevice *dev, struct ram_info *info);
38
39#endif