Simon Glass | 6494d70 | 2014-02-26 15:59:18 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2013 Google, Inc |
| 3 | * |
| 4 | * (C) Copyright 2012 |
| 5 | * Pavel Herrmann <morpheus.ibis@gmail.com> |
| 6 | * Marek Vasut <marex@denx.de> |
| 7 | * |
| 8 | * SPDX-License-Identifier: GPL-2.0+ |
| 9 | */ |
| 10 | |
| 11 | #ifndef _DM_DEVICE_H |
| 12 | #define _DM_DEVICE_H |
| 13 | |
| 14 | #include <dm/uclass-id.h> |
Peng Fan | c9cac3f | 2015-02-10 14:46:32 +0800 | [diff] [blame] | 15 | #include <fdtdec.h> |
Simon Glass | 6494d70 | 2014-02-26 15:59:18 -0700 | [diff] [blame] | 16 | #include <linker_lists.h> |
| 17 | #include <linux/list.h> |
| 18 | |
| 19 | struct driver_info; |
| 20 | |
| 21 | /* Driver is active (probed). Cleared when it is removed */ |
| 22 | #define DM_FLAG_ACTIVATED (1 << 0) |
| 23 | |
| 24 | /* DM is responsible for allocating and freeing platdata */ |
Simon Glass | f2bc6fc | 2014-06-11 23:29:54 -0600 | [diff] [blame] | 25 | #define DM_FLAG_ALLOC_PDATA (1 << 1) |
Simon Glass | 6494d70 | 2014-02-26 15:59:18 -0700 | [diff] [blame] | 26 | |
Simon Glass | 00606d7 | 2014-07-23 06:55:03 -0600 | [diff] [blame] | 27 | /* DM should init this device prior to relocation */ |
| 28 | #define DM_FLAG_PRE_RELOC (1 << 2) |
| 29 | |
Simon Glass | cdc133b | 2015-01-25 08:27:01 -0700 | [diff] [blame] | 30 | /* DM is responsible for allocating and freeing parent_platdata */ |
| 31 | #define DM_FLAG_ALLOC_PARENT_PDATA (1 << 3) |
| 32 | |
Simon Glass | 2c03c46 | 2015-03-25 12:21:53 -0600 | [diff] [blame^] | 33 | /* Allocate driver private data on a DMA boundary */ |
| 34 | #define DM_FLAG_ALLOC_PRIV_DMA (1 << 4) |
| 35 | |
Simon Glass | 6494d70 | 2014-02-26 15:59:18 -0700 | [diff] [blame] | 36 | /** |
Heiko Schocher | 54c5d08 | 2014-05-22 12:43:05 +0200 | [diff] [blame] | 37 | * struct udevice - An instance of a driver |
Simon Glass | 6494d70 | 2014-02-26 15:59:18 -0700 | [diff] [blame] | 38 | * |
| 39 | * This holds information about a device, which is a driver bound to a |
| 40 | * particular port or peripheral (essentially a driver instance). |
| 41 | * |
| 42 | * A device will come into existence through a 'bind' call, either due to |
| 43 | * a U_BOOT_DEVICE() macro (in which case platdata is non-NULL) or a node |
| 44 | * in the device tree (in which case of_offset is >= 0). In the latter case |
| 45 | * we translate the device tree information into platdata in a function |
| 46 | * implemented by the driver ofdata_to_platdata method (called just before the |
| 47 | * probe method if the device has a device tree node. |
| 48 | * |
| 49 | * All three of platdata, priv and uclass_priv can be allocated by the |
| 50 | * driver, or you can use the auto_alloc_size members of struct driver and |
| 51 | * struct uclass_driver to have driver model do this automatically. |
| 52 | * |
| 53 | * @driver: The driver used by this device |
| 54 | * @name: Name of device, typically the FDT node name |
| 55 | * @platdata: Configuration data for this device |
Simon Glass | cdc133b | 2015-01-25 08:27:01 -0700 | [diff] [blame] | 56 | * @parent_platdata: The parent bus's configuration data for this device |
Simon Glass | 6494d70 | 2014-02-26 15:59:18 -0700 | [diff] [blame] | 57 | * @of_offset: Device tree node offset for this device (- for none) |
Simon Glass | 2ef249b | 2014-11-11 10:46:18 -0700 | [diff] [blame] | 58 | * @of_id: Pointer to the udevice_id structure which created the device |
Simon Glass | 6494d70 | 2014-02-26 15:59:18 -0700 | [diff] [blame] | 59 | * @parent: Parent of this device, or NULL for the top level device |
| 60 | * @priv: Private data for this device |
| 61 | * @uclass: Pointer to uclass for this device |
| 62 | * @uclass_priv: The uclass's private data for this device |
Simon Glass | e59f458 | 2014-07-23 06:55:20 -0600 | [diff] [blame] | 63 | * @parent_priv: The parent's private data for this device |
Simon Glass | 6494d70 | 2014-02-26 15:59:18 -0700 | [diff] [blame] | 64 | * @uclass_node: Used by uclass to link its devices |
| 65 | * @child_head: List of children of this device |
| 66 | * @sibling_node: Next device in list of all devices |
| 67 | * @flags: Flags for this device DM_FLAG_... |
Simon Glass | 5a66a8f | 2014-07-23 06:55:12 -0600 | [diff] [blame] | 68 | * @req_seq: Requested sequence number for this device (-1 = any) |
Simon Glass | 547cea1 | 2014-10-13 23:41:51 -0600 | [diff] [blame] | 69 | * @seq: Allocated sequence number for this device (-1 = none). This is set up |
| 70 | * when the device is probed and will be unique within the device's uclass. |
Simon Glass | 6494d70 | 2014-02-26 15:59:18 -0700 | [diff] [blame] | 71 | */ |
Heiko Schocher | 54c5d08 | 2014-05-22 12:43:05 +0200 | [diff] [blame] | 72 | struct udevice { |
Simon Glass | 6494d70 | 2014-02-26 15:59:18 -0700 | [diff] [blame] | 73 | struct driver *driver; |
| 74 | const char *name; |
| 75 | void *platdata; |
Simon Glass | cdc133b | 2015-01-25 08:27:01 -0700 | [diff] [blame] | 76 | void *parent_platdata; |
Simon Glass | 6494d70 | 2014-02-26 15:59:18 -0700 | [diff] [blame] | 77 | int of_offset; |
Simon Glass | 2ef249b | 2014-11-11 10:46:18 -0700 | [diff] [blame] | 78 | const struct udevice_id *of_id; |
Heiko Schocher | 54c5d08 | 2014-05-22 12:43:05 +0200 | [diff] [blame] | 79 | struct udevice *parent; |
Simon Glass | 6494d70 | 2014-02-26 15:59:18 -0700 | [diff] [blame] | 80 | void *priv; |
| 81 | struct uclass *uclass; |
| 82 | void *uclass_priv; |
Simon Glass | e59f458 | 2014-07-23 06:55:20 -0600 | [diff] [blame] | 83 | void *parent_priv; |
Simon Glass | 6494d70 | 2014-02-26 15:59:18 -0700 | [diff] [blame] | 84 | struct list_head uclass_node; |
| 85 | struct list_head child_head; |
| 86 | struct list_head sibling_node; |
| 87 | uint32_t flags; |
Simon Glass | 5a66a8f | 2014-07-23 06:55:12 -0600 | [diff] [blame] | 88 | int req_seq; |
| 89 | int seq; |
Simon Glass | 6494d70 | 2014-02-26 15:59:18 -0700 | [diff] [blame] | 90 | }; |
| 91 | |
Simon Glass | 5a66a8f | 2014-07-23 06:55:12 -0600 | [diff] [blame] | 92 | /* Maximum sequence number supported */ |
| 93 | #define DM_MAX_SEQ 999 |
| 94 | |
Simon Glass | 6494d70 | 2014-02-26 15:59:18 -0700 | [diff] [blame] | 95 | /* Returns the operations for a device */ |
| 96 | #define device_get_ops(dev) (dev->driver->ops) |
| 97 | |
| 98 | /* Returns non-zero if the device is active (probed and not removed) */ |
| 99 | #define device_active(dev) ((dev)->flags & DM_FLAG_ACTIVATED) |
| 100 | |
| 101 | /** |
Simon Glass | ae7f451 | 2014-06-11 23:29:45 -0600 | [diff] [blame] | 102 | * struct udevice_id - Lists the compatible strings supported by a driver |
Simon Glass | 6494d70 | 2014-02-26 15:59:18 -0700 | [diff] [blame] | 103 | * @compatible: Compatible string |
| 104 | * @data: Data for this compatible string |
| 105 | */ |
Simon Glass | ae7f451 | 2014-06-11 23:29:45 -0600 | [diff] [blame] | 106 | struct udevice_id { |
Simon Glass | 6494d70 | 2014-02-26 15:59:18 -0700 | [diff] [blame] | 107 | const char *compatible; |
| 108 | ulong data; |
| 109 | }; |
| 110 | |
Masahiro Yamada | f887cb6 | 2014-10-07 14:51:31 +0900 | [diff] [blame] | 111 | #ifdef CONFIG_OF_CONTROL |
| 112 | #define of_match_ptr(_ptr) (_ptr) |
| 113 | #else |
| 114 | #define of_match_ptr(_ptr) NULL |
| 115 | #endif /* CONFIG_OF_CONTROL */ |
| 116 | |
Simon Glass | 6494d70 | 2014-02-26 15:59:18 -0700 | [diff] [blame] | 117 | /** |
| 118 | * struct driver - A driver for a feature or peripheral |
| 119 | * |
| 120 | * This holds methods for setting up a new device, and also removing it. |
| 121 | * The device needs information to set itself up - this is provided either |
| 122 | * by platdata or a device tree node (which we find by looking up |
| 123 | * matching compatible strings with of_match). |
| 124 | * |
| 125 | * Drivers all belong to a uclass, representing a class of devices of the |
| 126 | * same type. Common elements of the drivers can be implemented in the uclass, |
| 127 | * or the uclass can provide a consistent interface to the drivers within |
| 128 | * it. |
| 129 | * |
| 130 | * @name: Device name |
| 131 | * @id: Identiies the uclass we belong to |
| 132 | * @of_match: List of compatible strings to match, and any identifying data |
| 133 | * for each. |
| 134 | * @bind: Called to bind a device to its driver |
| 135 | * @probe: Called to probe a device, i.e. activate it |
| 136 | * @remove: Called to remove a device, i.e. de-activate it |
| 137 | * @unbind: Called to unbind a device from its driver |
| 138 | * @ofdata_to_platdata: Called before probe to decode device tree data |
Simon Glass | 0118ce7 | 2015-01-25 08:27:03 -0700 | [diff] [blame] | 139 | * @child_post_bind: Called after a new child has been bound |
Simon Glass | a327dee | 2014-07-23 06:55:21 -0600 | [diff] [blame] | 140 | * @child_pre_probe: Called before a child device is probed. The device has |
| 141 | * memory allocated but it has not yet been probed. |
| 142 | * @child_post_remove: Called after a child device is removed. The device |
| 143 | * has memory allocated but its device_remove() method has been called. |
Simon Glass | 6494d70 | 2014-02-26 15:59:18 -0700 | [diff] [blame] | 144 | * @priv_auto_alloc_size: If non-zero this is the size of the private data |
| 145 | * to be allocated in the device's ->priv pointer. If zero, then the driver |
| 146 | * is responsible for allocating any data required. |
| 147 | * @platdata_auto_alloc_size: If non-zero this is the size of the |
| 148 | * platform data to be allocated in the device's ->platdata pointer. |
| 149 | * This is typically only useful for device-tree-aware drivers (those with |
| 150 | * an of_match), since drivers which use platdata will have the data |
| 151 | * provided in the U_BOOT_DEVICE() instantiation. |
Simon Glass | e59f458 | 2014-07-23 06:55:20 -0600 | [diff] [blame] | 152 | * @per_child_auto_alloc_size: Each device can hold private data owned by |
| 153 | * its parent. If required this will be automatically allocated if this |
| 154 | * value is non-zero. |
Simon Glass | accd4b1 | 2014-10-13 23:41:50 -0600 | [diff] [blame] | 155 | * TODO(sjg@chromium.org): I'm considering dropping this, and just having |
| 156 | * device_probe_child() pass it in. So far the use case for allocating it |
| 157 | * is SPI, but I found that unsatisfactory. Since it is here I will leave it |
| 158 | * until things are clearer. |
Simon Glass | cdc133b | 2015-01-25 08:27:01 -0700 | [diff] [blame] | 159 | * @per_child_platdata_auto_alloc_size: A bus likes to store information about |
| 160 | * its children. If non-zero this is the size of this data, to be allocated |
| 161 | * in the child's parent_platdata pointer. |
Simon Glass | 0040b94 | 2014-07-23 06:55:17 -0600 | [diff] [blame] | 162 | * @ops: Driver-specific operations. This is typically a list of function |
Simon Glass | 6494d70 | 2014-02-26 15:59:18 -0700 | [diff] [blame] | 163 | * pointers defined by the driver, to implement driver functions required by |
| 164 | * the uclass. |
Simon Glass | 00606d7 | 2014-07-23 06:55:03 -0600 | [diff] [blame] | 165 | * @flags: driver flags - see DM_FLAGS_... |
Simon Glass | 6494d70 | 2014-02-26 15:59:18 -0700 | [diff] [blame] | 166 | */ |
| 167 | struct driver { |
| 168 | char *name; |
| 169 | enum uclass_id id; |
Simon Glass | ae7f451 | 2014-06-11 23:29:45 -0600 | [diff] [blame] | 170 | const struct udevice_id *of_match; |
Heiko Schocher | 54c5d08 | 2014-05-22 12:43:05 +0200 | [diff] [blame] | 171 | int (*bind)(struct udevice *dev); |
| 172 | int (*probe)(struct udevice *dev); |
| 173 | int (*remove)(struct udevice *dev); |
| 174 | int (*unbind)(struct udevice *dev); |
| 175 | int (*ofdata_to_platdata)(struct udevice *dev); |
Simon Glass | 0118ce7 | 2015-01-25 08:27:03 -0700 | [diff] [blame] | 176 | int (*child_post_bind)(struct udevice *dev); |
Simon Glass | a327dee | 2014-07-23 06:55:21 -0600 | [diff] [blame] | 177 | int (*child_pre_probe)(struct udevice *dev); |
| 178 | int (*child_post_remove)(struct udevice *dev); |
Simon Glass | 6494d70 | 2014-02-26 15:59:18 -0700 | [diff] [blame] | 179 | int priv_auto_alloc_size; |
| 180 | int platdata_auto_alloc_size; |
Simon Glass | e59f458 | 2014-07-23 06:55:20 -0600 | [diff] [blame] | 181 | int per_child_auto_alloc_size; |
Simon Glass | cdc133b | 2015-01-25 08:27:01 -0700 | [diff] [blame] | 182 | int per_child_platdata_auto_alloc_size; |
Simon Glass | 6494d70 | 2014-02-26 15:59:18 -0700 | [diff] [blame] | 183 | const void *ops; /* driver-specific operations */ |
Simon Glass | 00606d7 | 2014-07-23 06:55:03 -0600 | [diff] [blame] | 184 | uint32_t flags; |
Simon Glass | 6494d70 | 2014-02-26 15:59:18 -0700 | [diff] [blame] | 185 | }; |
| 186 | |
| 187 | /* Declare a new U-Boot driver */ |
| 188 | #define U_BOOT_DRIVER(__name) \ |
| 189 | ll_entry_declare(struct driver, __name, driver) |
| 190 | |
| 191 | /** |
| 192 | * dev_get_platdata() - Get the platform data for a device |
| 193 | * |
| 194 | * This checks that dev is not NULL, but no other checks for now |
| 195 | * |
| 196 | * @dev Device to check |
| 197 | * @return platform data, or NULL if none |
| 198 | */ |
Heiko Schocher | 54c5d08 | 2014-05-22 12:43:05 +0200 | [diff] [blame] | 199 | void *dev_get_platdata(struct udevice *dev); |
Simon Glass | 6494d70 | 2014-02-26 15:59:18 -0700 | [diff] [blame] | 200 | |
| 201 | /** |
Simon Glass | cdc133b | 2015-01-25 08:27:01 -0700 | [diff] [blame] | 202 | * dev_get_parent_platdata() - Get the parent platform data for a device |
| 203 | * |
| 204 | * This checks that dev is not NULL, but no other checks for now |
| 205 | * |
| 206 | * @dev Device to check |
| 207 | * @return parent's platform data, or NULL if none |
| 208 | */ |
| 209 | void *dev_get_parent_platdata(struct udevice *dev); |
| 210 | |
| 211 | /** |
Simon Glass | e59f458 | 2014-07-23 06:55:20 -0600 | [diff] [blame] | 212 | * dev_get_parentdata() - Get the parent data for a device |
| 213 | * |
| 214 | * The parent data is data stored in the device but owned by the parent. |
| 215 | * For example, a USB device may have parent data which contains information |
| 216 | * about how to talk to the device over USB. |
| 217 | * |
| 218 | * This checks that dev is not NULL, but no other checks for now |
| 219 | * |
| 220 | * @dev Device to check |
| 221 | * @return parent data, or NULL if none |
| 222 | */ |
| 223 | void *dev_get_parentdata(struct udevice *dev); |
| 224 | |
| 225 | /** |
Simon Glass | 6494d70 | 2014-02-26 15:59:18 -0700 | [diff] [blame] | 226 | * dev_get_priv() - Get the private data for a device |
| 227 | * |
| 228 | * This checks that dev is not NULL, but no other checks for now |
| 229 | * |
| 230 | * @dev Device to check |
| 231 | * @return private data, or NULL if none |
| 232 | */ |
Heiko Schocher | 54c5d08 | 2014-05-22 12:43:05 +0200 | [diff] [blame] | 233 | void *dev_get_priv(struct udevice *dev); |
Simon Glass | 6494d70 | 2014-02-26 15:59:18 -0700 | [diff] [blame] | 234 | |
Simon Glass | 5a66a8f | 2014-07-23 06:55:12 -0600 | [diff] [blame] | 235 | /** |
Simon Glass | 479728c | 2014-11-11 10:46:19 -0700 | [diff] [blame] | 236 | * struct dev_get_parent() - Get the parent of a device |
| 237 | * |
| 238 | * @child: Child to check |
| 239 | * @return parent of child, or NULL if this is the root device |
| 240 | */ |
| 241 | struct udevice *dev_get_parent(struct udevice *child); |
| 242 | |
| 243 | /** |
Simon Glass | e564f05 | 2015-03-05 12:25:20 -0700 | [diff] [blame] | 244 | * dev_get_uclass_priv() - Get the private uclass data for a device |
| 245 | * |
| 246 | * This checks that dev is not NULL, but no other checks for now |
| 247 | * |
| 248 | * @dev Device to check |
| 249 | * @return private uclass data for this device, or NULL if none |
| 250 | */ |
| 251 | void *dev_get_uclass_priv(struct udevice *dev); |
| 252 | |
| 253 | /** |
Simon Glass | 2ef249b | 2014-11-11 10:46:18 -0700 | [diff] [blame] | 254 | * dev_get_of_data() - get the device tree data used to bind a device |
| 255 | * |
| 256 | * When a device is bound using a device tree node, it matches a |
| 257 | * particular compatible string as in struct udevice_id. This function |
| 258 | * returns the associated data value for that compatible string |
| 259 | */ |
| 260 | ulong dev_get_of_data(struct udevice *dev); |
| 261 | |
Simon Glass | b367053 | 2015-01-25 08:27:04 -0700 | [diff] [blame] | 262 | /* |
| 263 | * device_get_uclass_id() - return the uclass ID of a device |
| 264 | * |
| 265 | * @dev: Device to check |
| 266 | * @return uclass ID for the device |
| 267 | */ |
| 268 | enum uclass_id device_get_uclass_id(struct udevice *dev); |
| 269 | |
Simon Glass | 2ef249b | 2014-11-11 10:46:18 -0700 | [diff] [blame] | 270 | /** |
Simon Glass | 997c87b | 2014-07-23 06:55:19 -0600 | [diff] [blame] | 271 | * device_get_child() - Get the child of a device by index |
| 272 | * |
| 273 | * Returns the numbered child, 0 being the first. This does not use |
| 274 | * sequence numbers, only the natural order. |
| 275 | * |
| 276 | * @dev: Parent device to check |
| 277 | * @index: Child index |
| 278 | * @devp: Returns pointer to device |
| 279 | */ |
| 280 | int device_get_child(struct udevice *parent, int index, struct udevice **devp); |
| 281 | |
| 282 | /** |
Simon Glass | 5a66a8f | 2014-07-23 06:55:12 -0600 | [diff] [blame] | 283 | * device_find_child_by_seq() - Find a child device based on a sequence |
| 284 | * |
| 285 | * This searches for a device with the given seq or req_seq. |
| 286 | * |
| 287 | * For seq, if an active device has this sequence it will be returned. |
| 288 | * If there is no such device then this will return -ENODEV. |
| 289 | * |
| 290 | * For req_seq, if a device (whether activated or not) has this req_seq |
| 291 | * value, that device will be returned. This is a strong indication that |
| 292 | * the device will receive that sequence when activated. |
| 293 | * |
| 294 | * @parent: Parent device |
| 295 | * @seq_or_req_seq: Sequence number to find (0=first) |
| 296 | * @find_req_seq: true to find req_seq, false to find seq |
| 297 | * @devp: Returns pointer to device (there is only one per for each seq). |
| 298 | * Set to NULL if none is found |
| 299 | * @return 0 if OK, -ve on error |
| 300 | */ |
| 301 | int device_find_child_by_seq(struct udevice *parent, int seq_or_req_seq, |
| 302 | bool find_req_seq, struct udevice **devp); |
| 303 | |
Simon Glass | 997c87b | 2014-07-23 06:55:19 -0600 | [diff] [blame] | 304 | /** |
| 305 | * device_get_child_by_seq() - Get a child device based on a sequence |
| 306 | * |
| 307 | * If an active device has this sequence it will be returned. If there is no |
| 308 | * such device then this will check for a device that is requesting this |
| 309 | * sequence. |
| 310 | * |
| 311 | * The device is probed to activate it ready for use. |
| 312 | * |
| 313 | * @parent: Parent device |
| 314 | * @seq: Sequence number to find (0=first) |
| 315 | * @devp: Returns pointer to device (there is only one per for each seq) |
| 316 | * Set to NULL if none is found |
| 317 | * @return 0 if OK, -ve on error |
| 318 | */ |
| 319 | int device_get_child_by_seq(struct udevice *parent, int seq, |
| 320 | struct udevice **devp); |
| 321 | |
| 322 | /** |
| 323 | * device_find_child_by_of_offset() - Find a child device based on FDT offset |
| 324 | * |
| 325 | * Locates a child device by its device tree offset. |
| 326 | * |
| 327 | * @parent: Parent device |
| 328 | * @of_offset: Device tree offset to find |
| 329 | * @devp: Returns pointer to device if found, otherwise this is set to NULL |
| 330 | * @return 0 if OK, -ve on error |
| 331 | */ |
| 332 | int device_find_child_by_of_offset(struct udevice *parent, int of_offset, |
| 333 | struct udevice **devp); |
| 334 | |
| 335 | /** |
| 336 | * device_get_child_by_of_offset() - Get a child device based on FDT offset |
| 337 | * |
| 338 | * Locates a child device by its device tree offset. |
| 339 | * |
| 340 | * The device is probed to activate it ready for use. |
| 341 | * |
| 342 | * @parent: Parent device |
| 343 | * @of_offset: Device tree offset to find |
| 344 | * @devp: Returns pointer to device if found, otherwise this is set to NULL |
| 345 | * @return 0 if OK, -ve on error |
| 346 | */ |
| 347 | int device_get_child_by_of_offset(struct udevice *parent, int seq, |
| 348 | struct udevice **devp); |
| 349 | |
Simon Glass | a8981d4 | 2014-10-13 23:41:49 -0600 | [diff] [blame] | 350 | /** |
| 351 | * device_find_first_child() - Find the first child of a device |
| 352 | * |
| 353 | * @parent: Parent device to search |
| 354 | * @devp: Returns first child device, or NULL if none |
| 355 | * @return 0 |
| 356 | */ |
| 357 | int device_find_first_child(struct udevice *parent, struct udevice **devp); |
| 358 | |
| 359 | /** |
| 360 | * device_find_first_child() - Find the first child of a device |
| 361 | * |
| 362 | * @devp: Pointer to previous child device on entry. Returns pointer to next |
| 363 | * child device, or NULL if none |
| 364 | * @return 0 |
| 365 | */ |
| 366 | int device_find_next_child(struct udevice **devp); |
| 367 | |
Peng Fan | c9cac3f | 2015-02-10 14:46:32 +0800 | [diff] [blame] | 368 | /** |
| 369 | * dev_get_addr() - Get the reg property of a device |
| 370 | * |
| 371 | * @dev: Pointer to a device |
| 372 | * |
| 373 | * @return addr |
| 374 | */ |
| 375 | fdt_addr_t dev_get_addr(struct udevice *dev); |
| 376 | |
Simon Glass | 6494d70 | 2014-02-26 15:59:18 -0700 | [diff] [blame] | 377 | #endif |