"Das U-Boot" Source Tree
at master 41 lines 802 B view raw
1/* SPDX-License-Identifier: GPL-2.0+ */ 2/* 3 * Copyright (c) 2015 Google, Inc 4 * Written by Simon Glass <sjg@chromium.org> 5 */ 6 7#ifndef __RAM_H 8#define __RAM_H 9 10#include <linux/types.h> 11 12struct udevice; 13 14struct ram_info { 15 phys_addr_t base; 16 size_t size; 17}; 18 19struct ram_ops { 20 /** 21 * get_info() - Get basic memory info 22 * 23 * @dev: Device to check (UCLASS_RAM) 24 * @info: Place to put info 25 * @return 0 if OK, -ve on error 26 */ 27 int (*get_info)(struct udevice *dev, struct ram_info *info); 28}; 29 30#define ram_get_ops(dev) ((struct ram_ops *)(dev)->driver->ops) 31 32/** 33 * ram_get_info() - Get information about a RAM device 34 * 35 * @dev: Device to check (UCLASS_RAM) 36 * @info: Returns RAM info 37 * Return: 0 if OK, -ve on error 38 */ 39int ram_get_info(struct udevice *dev, struct ram_info *info); 40 41#endif