2 * Copyright (c) 2017 Google, Inc
5 * Pavel Herrmann <morpheus.ibis@gmail.com>
6 * Marek Vasut <marex@denx.de>
8 * SPDX-License-Identifier: GPL-2.0+
19 * dev_get_addr() - Get the reg property of a device
21 * @dev: Pointer to a device
25 fdt_addr_t dev_get_addr(struct udevice *dev);
28 * dev_get_addr_ptr() - Return pointer to the address of the reg property
31 * @dev: Pointer to a device
33 * @return Pointer to addr, or NULL if there is no such property
35 void *dev_get_addr_ptr(struct udevice *dev);
38 * dev_map_physmem() - Read device address from reg property of the
39 * device node and map the address into CPU address
42 * @dev: Pointer to device
43 * @size: size of the memory to map
45 * @return mapped address, or NULL if the device does not have reg
48 void *dev_map_physmem(struct udevice *dev, unsigned long size);
51 * dev_get_addr_index() - Get the indexed reg property of a device
53 * @dev: Pointer to a device
54 * @index: the 'reg' property can hold a list of <addr, size> pairs
55 * and @index is used to select which one is required
59 fdt_addr_t dev_get_addr_index(struct udevice *dev, int index);
62 * dev_get_addr_size_index() - Get the indexed reg property of a device
64 * Returns the address and size specified in the 'reg' property of a device.
66 * @dev: Pointer to a device
67 * @index: the 'reg' property can hold a list of <addr, size> pairs
68 * and @index is used to select which one is required
69 * @size: Pointer to size varible - this function returns the size
70 * specified in the 'reg' property here
74 fdt_addr_t dev_get_addr_size_index(struct udevice *dev, int index,
78 * dev_get_addr_name() - Get the reg property of a device, indexed by name
80 * @dev: Pointer to a device
81 * @name: the 'reg' property can hold a list of <addr, size> pairs, with the
82 * 'reg-names' property providing named-based identification. @index
83 * indicates the value to search for in 'reg-names'.
87 fdt_addr_t dev_get_addr_name(struct udevice *dev, const char *name);
90 * dm_set_translation_offset() - Set translation offset
91 * @offs: Translation offset
93 * Some platforms need a special address translation. Those
94 * platforms (e.g. mvebu in SPL) can configure a translation
95 * offset in the DM by calling this function. It will be
96 * added to all addresses returned in dev_get_addr().
98 void dm_set_translation_offset(fdt_addr_t offs);
101 * dm_get_translation_offset() - Get translation offset
103 * This function returns the translation offset that can
104 * be configured by calling dm_set_translation_offset().
106 * @return translation offset for the device address (0 as default).
108 fdt_addr_t dm_get_translation_offset(void);