diff options
Diffstat (limited to 'include/dm')
-rw-r--r-- | include/dm/device-internal.h | 22 | ||||
-rw-r--r-- | include/dm/device.h | 87 | ||||
-rw-r--r-- | include/dm/lists.h | 2 | ||||
-rw-r--r-- | include/dm/ofnode.h | 23 | ||||
-rw-r--r-- | include/dm/pci.h | 2 | ||||
-rw-r--r-- | include/dm/platdata.h | 10 | ||||
-rw-r--r-- | include/dm/platform_data/fsl_espi.h | 2 | ||||
-rw-r--r-- | include/dm/platform_data/lpc32xx_hsuart.h | 4 | ||||
-rw-r--r-- | include/dm/platform_data/pxa_mmc_gen.h | 2 | ||||
-rw-r--r-- | include/dm/platform_data/serial_bcm283x_mu.h | 2 | ||||
-rw-r--r-- | include/dm/platform_data/serial_coldfire.h | 4 | ||||
-rw-r--r-- | include/dm/platform_data/serial_mxc.h | 2 | ||||
-rw-r--r-- | include/dm/platform_data/serial_pl01x.h | 2 | ||||
-rw-r--r-- | include/dm/platform_data/serial_pxa.h | 4 | ||||
-rw-r--r-- | include/dm/platform_data/serial_sh.h | 2 | ||||
-rw-r--r-- | include/dm/platform_data/spi_coldfire.h | 4 | ||||
-rw-r--r-- | include/dm/platform_data/spi_davinci.h | 2 | ||||
-rw-r--r-- | include/dm/platform_data/spi_pl022.h | 2 | ||||
-rw-r--r-- | include/dm/root.h | 14 | ||||
-rw-r--r-- | include/dm/uclass.h | 24 |
20 files changed, 114 insertions, 102 deletions
diff --git a/include/dm/device-internal.h b/include/dm/device-internal.h index c5d7ec0650..af3b6b2b05 100644 --- a/include/dm/device-internal.h +++ b/include/dm/device-internal.h @@ -19,8 +19,8 @@ struct udevice; * device_bind() - Create a device and bind it to a driver * * Called to set up a new device attached to a driver. The device will either - * have platdata, or a device tree node which can be used to create the - * platdata. + * have plat, or a device tree node which can be used to create the + * plat. * * Once bound a device exists but is not yet active until device_probe() is * called. @@ -28,22 +28,18 @@ struct udevice; * @parent: Pointer to device's parent, under which this driver will exist * @drv: Device's driver * @name: Name of device (e.g. device tree node name) - * @platdata: Pointer to data for this device - the structure is device- + * @plat: Pointer to data for this device - the structure is device- * specific but may include the device's I/O address, etc.. This is NULL for * devices which use device tree. - * @of_offset: Offset of device tree node for this device. This is -1 for - * devices which don't use device tree. + * @ofnode: Devicetree node for this device. This is ofnode_null() for + * devices which don't use devicetree or don't have a node. * @devp: if non-NULL, returns a pointer to the bound device * @return 0 if OK, -ve on error */ int device_bind(struct udevice *parent, const struct driver *drv, - const char *name, void *platdata, int of_offset, + const char *name, void *plat, ofnode node, struct udevice **devp); -int device_bind_ofnode(struct udevice *parent, const struct driver *drv, - const char *name, void *platdata, ofnode node, - struct udevice **devp); - /** * device_bind_with_driver_data() - Create a device and bind it to a driver * @@ -76,7 +72,7 @@ int device_bind_with_driver_data(struct udevice *parent, * @parent: Pointer to device's parent * @pre_reloc_only: If true, bind the driver only if its DM_FLAG_PRE_RELOC flag * is set. If false bind the driver always. - * @info: Name and platdata for this device + * @info: Name and plat for this device * @devp: if non-NULL, returns a pointer to the bound device * @return 0 if OK, -ve on error */ @@ -93,7 +89,7 @@ int device_bind_by_name(struct udevice *parent, bool pre_reloc_only, int device_reparent(struct udevice *dev, struct udevice *new_parent); /** - * device_ofdata_to_platdata() - Read platform data for a device + * device_of_to_plat() - Read platform data for a device * * Read platform data for a device (typically from the device tree) so that * the information needed to probe the device is present. @@ -106,7 +102,7 @@ int device_reparent(struct udevice *dev, struct udevice *new_parent); * @dev: Pointer to device to process * @return 0 if OK, -ve on error */ -int device_ofdata_to_platdata(struct udevice *dev); +int device_of_to_plat(struct udevice *dev); /** * device_probe() - Probe a device, activating it diff --git a/include/dm/device.h b/include/dm/device.h index 5bef484247..ed80ae4494 100644 --- a/include/dm/device.h +++ b/include/dm/device.h @@ -23,16 +23,16 @@ struct driver_info; /* Driver is active (probed). Cleared when it is removed */ #define DM_FLAG_ACTIVATED (1 << 0) -/* DM is responsible for allocating and freeing platdata */ +/* DM is responsible for allocating and freeing plat */ #define DM_FLAG_ALLOC_PDATA (1 << 1) /* DM should init this device prior to relocation */ #define DM_FLAG_PRE_RELOC (1 << 2) -/* DM is responsible for allocating and freeing parent_platdata */ +/* DM is responsible for allocating and freeing parent_plat */ #define DM_FLAG_ALLOC_PARENT_PDATA (1 << 3) -/* DM is responsible for allocating and freeing uclass_platdata */ +/* DM is responsible for allocating and freeing uclass_plat */ #define DM_FLAG_ALLOC_UCLASS_PDATA (1 << 4) /* Allocate driver private data on a DMA boundary */ @@ -64,7 +64,7 @@ struct driver_info; /* DM does not enable/disable the power domains corresponding to this device */ #define DM_FLAG_DEFAULT_PD_CTRL_OFF (1 << 11) -/* Driver platdata has been read. Cleared when the device is removed */ +/* Driver plat has been read. Cleared when the device is removed */ #define DM_FLAG_PLATDATA_VALID (1 << 12) /* @@ -104,21 +104,21 @@ enum { * particular port or peripheral (essentially a driver instance). * * A device will come into existence through a 'bind' call, either due to - * a U_BOOT_DEVICE() macro (in which case platdata is non-NULL) or a node + * a U_BOOT_DEVICE() macro (in which case plat is non-NULL) or a node * in the device tree (in which case of_offset is >= 0). In the latter case - * we translate the device tree information into platdata in a function - * implemented by the driver ofdata_to_platdata method (called just before the + * we translate the device tree information into plat in a function + * implemented by the driver of_to_plat method (called just before the * probe method if the device has a device tree node. * - * All three of platdata, priv and uclass_priv can be allocated by the + * All three of plat, priv and uclass_priv can be allocated by the * driver, or you can use the auto_alloc_size members of struct driver and * struct uclass_driver to have driver model do this automatically. * * @driver: The driver used by this device * @name: Name of device, typically the FDT node name - * @platdata: Configuration data for this device - * @parent_platdata: The parent bus's configuration data for this device - * @uclass_platdata: The uclass's configuration data for this device + * @plat: Configuration data for this device + * @parent_plat: The parent bus's configuration data for this device + * @uclass_plat: The uclass's configuration data for this device * @node: Reference to device tree node for this device * @driver_data: Driver data word for the entry that matched this device with * its driver @@ -142,9 +142,9 @@ enum { struct udevice { const struct driver *driver; const char *name; - void *platdata; - void *parent_platdata; - void *uclass_platdata; + void *plat; + void *parent_plat; + void *uclass_plat; ofnode node; ulong driver_data; struct udevice *parent; @@ -177,11 +177,6 @@ static inline int dev_of_offset(const struct udevice *dev) return ofnode_to_offset(dev->node); } -static inline void dev_set_of_offset(struct udevice *dev, int of_offset) -{ - dev->node = offset_to_ofnode(of_offset); -} - static inline bool dev_has_of_node(struct udevice *dev) { return ofnode_valid(dev->node); @@ -208,7 +203,7 @@ struct udevice_id { * * This holds methods for setting up a new device, and also removing it. * The device needs information to set itself up - this is provided either - * by platdata or a device tree node (which we find by looking up + * by plat or a device tree node (which we find by looking up * matching compatible strings with of_match). * * Drivers all belong to a uclass, representing a class of devices of the @@ -224,26 +219,26 @@ struct udevice_id { * @probe: Called to probe a device, i.e. activate it * @remove: Called to remove a device, i.e. de-activate it * @unbind: Called to unbind a device from its driver - * @ofdata_to_platdata: Called before probe to decode device tree data + * @of_to_plat: Called before probe to decode device tree data * @child_post_bind: Called after a new child has been bound * @child_pre_probe: Called before a child device is probed. The device has * memory allocated but it has not yet been probed. * @child_post_remove: Called after a child device is removed. The device * has memory allocated but its device_remove() method has been called. - * @priv_auto_alloc_size: If non-zero this is the size of the private data + * @priv_auto: If non-zero this is the size of the private data * to be allocated in the device's ->priv pointer. If zero, then the driver * is responsible for allocating any data required. - * @platdata_auto_alloc_size: If non-zero this is the size of the - * platform data to be allocated in the device's ->platdata pointer. + * @plat_auto: If non-zero this is the size of the + * platform data to be allocated in the device's ->plat pointer. * This is typically only useful for device-tree-aware drivers (those with - * an of_match), since drivers which use platdata will have the data + * an of_match), since drivers which use plat will have the data * provided in the U_BOOT_DEVICE() instantiation. - * @per_child_auto_alloc_size: Each device can hold private data owned by + * @per_child_auto: Each device can hold private data owned by * its parent. If required this will be automatically allocated if this * value is non-zero. - * @per_child_platdata_auto_alloc_size: A bus likes to store information about + * @per_child_plat_auto: A bus likes to store information about * its children. If non-zero this is the size of this data, to be allocated - * in the child's parent_platdata pointer. + * in the child's parent_plat pointer. * @ops: Driver-specific operations. This is typically a list of function * pointers defined by the driver, to implement driver functions required by * the uclass. @@ -259,14 +254,14 @@ struct driver { int (*probe)(struct udevice *dev); int (*remove)(struct udevice *dev); int (*unbind)(struct udevice *dev); - int (*ofdata_to_platdata)(struct udevice *dev); + int (*of_to_plat)(struct udevice *dev); int (*child_post_bind)(struct udevice *dev); int (*child_pre_probe)(struct udevice *dev); int (*child_post_remove)(struct udevice *dev); - int priv_auto_alloc_size; - int platdata_auto_alloc_size; - int per_child_auto_alloc_size; - int per_child_platdata_auto_alloc_size; + int priv_auto; + int plat_auto; + int per_child_auto; + int per_child_plat_auto; const void *ops; /* driver-specific operations */ uint32_t flags; #if CONFIG_IS_ENABLED(ACPIGEN) @@ -290,34 +285,34 @@ struct driver { #define U_BOOT_DRIVER_ALIAS(__name, __alias) /** - * dev_get_platdata() - Get the platform data for a device + * dev_get_plat() - Get the platform data for a device * * This checks that dev is not NULL, but no other checks for now * * @dev Device to check * @return platform data, or NULL if none */ -void *dev_get_platdata(const struct udevice *dev); +void *dev_get_plat(const struct udevice *dev); /** - * dev_get_parent_platdata() - Get the parent platform data for a device + * dev_get_parent_plat() - Get the parent platform data for a device * * This checks that dev is not NULL, but no other checks for now * * @dev Device to check * @return parent's platform data, or NULL if none */ -void *dev_get_parent_platdata(const struct udevice *dev); +void *dev_get_parent_plat(const struct udevice *dev); /** - * dev_get_uclass_platdata() - Get the uclass platform data for a device + * dev_get_uclass_plat() - Get the uclass platform data for a device * * This checks that dev is not NULL, but no other checks for now * * @dev Device to check * @return uclass's platform data, or NULL if none */ -void *dev_get_uclass_platdata(const struct udevice *dev); +void *dev_get_uclass_plat(const struct udevice *dev); /** * dev_get_priv() - Get the private data for a device @@ -627,9 +622,9 @@ int device_find_child_by_name(const struct udevice *parent, const char *name, struct udevice **devp); /** - * device_first_child_ofdata_err() - Find the first child and reads its platdata + * device_first_child_ofdata_err() - Find the first child and reads its plat * - * The ofdata_to_platdata() method is called on the child before it is returned, + * The of_to_plat() method is called on the child before it is returned, * but the child is not probed. * * @parent: Parent to check @@ -640,9 +635,9 @@ int device_first_child_ofdata_err(struct udevice *parent, struct udevice **devp); /* - * device_next_child_ofdata_err() - Find the next child and read its platdata + * device_next_child_ofdata_err() - Find the next child and read its plat * - * The ofdata_to_platdata() method is called on the child before it is returned, + * The of_to_plat() method is called on the child before it is returned, * but the child is not probed. * * @devp: On entry, points to the previous child; on exit returns the child that @@ -803,19 +798,19 @@ static inline bool device_is_on_pci_bus(const struct udevice *dev) list_for_each_entry(pos, &parent->child_head, sibling_node) /** - * device_foreach_child_ofdata_to_platdata() - iterate through children + * device_foreach_child_of_to_plat() - iterate through children * * This stops when it gets an error, with @pos set to the device that failed to * read ofdata. * This creates a for() loop which works through the available children of * a device in order from start to end. Device ofdata is read by calling - * device_ofdata_to_platdata() on each one. The devices are not probed. + * device_of_to_plat() on each one. The devices are not probed. * * @pos: struct udevice * for the current device * @parent: parent device to scan */ -#define device_foreach_child_ofdata_to_platdata(pos, parent) \ +#define device_foreach_child_of_to_plat(pos, parent) \ for (int _ret = device_first_child_ofdata_err(parent, &dev); !_ret; \ _ret = device_next_child_ofdata_err(&dev)) diff --git a/include/dm/lists.h b/include/dm/lists.h index 810e244d9e..070bc9c19f 100644 --- a/include/dm/lists.h +++ b/include/dm/lists.h @@ -16,7 +16,7 @@ * lists_driver_lookup_name() - Return u_boot_driver corresponding to name * * This function returns a pointer to a driver given its name. This is used - * for binding a driver given its name and platdata. + * for binding a driver given its name and plat. * * @name: Name of driver to look up * @return pointer to driver, or NULL if not found diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h index ced7f6ffb2..53f04ac91d 100644 --- a/include/dm/ofnode.h +++ b/include/dm/ofnode.h @@ -218,6 +218,18 @@ static inline ofnode ofnode_null(void) return node; } +static inline ofnode ofnode_root(void) +{ + ofnode node; + + if (of_live_active()) + node.np = gd_of_root(); + else + node.of_offset = 0; + + return node; +} + /** * ofnode_read_u32() - Read a 32-bit integer from a property * @@ -345,6 +357,17 @@ const char *ofnode_read_string(ofnode node, const char *propname); */ int ofnode_read_u32_array(ofnode node, const char *propname, u32 *out_values, size_t sz); +/** + * ofnode_is_enabled() - Checks whether a node is enabled. + * This looks for a 'status' property. If this exists, then returns true if + * the status is 'okay' and false otherwise. If there is no status property, + * it returns true on the assumption that anything mentioned should be enabled + * by default. + * + * @node: node to examine + * @return false (not enabled) or true (enabled) + */ +bool ofnode_is_enabled(ofnode node); /** * ofnode_read_bool() - read a boolean value from a property diff --git a/include/dm/pci.h b/include/dm/pci.h index 10f9fd9e37..bddacbf599 100644 --- a/include/dm/pci.h +++ b/include/dm/pci.h @@ -30,7 +30,7 @@ int pci_get_devfn(struct udevice *dev); * * This returns an int to avoid a dependency on pci.h * - * @reg: reg value from dt-platdata.c array (first member). This is not a + * @reg: reg value from dt-plat.c array (first member). This is not a * pointer type, since the caller may use fdt32_t or fdt64_t depending on * the address sizes. * @return device/function for that device (pci_dev_t format) diff --git a/include/dm/platdata.h b/include/dm/platdata.h index 216efa8ef7..d650fb3919 100644 --- a/include/dm/platdata.h +++ b/include/dm/platdata.h @@ -20,15 +20,15 @@ * available). U-Boot's driver model uses device tree for configuration. * * @name: Driver name - * @platdata: Driver-specific platform data - * @platdata_size: Size of platform data structure + * @plat: Driver-specific platform data + * @plat_size: Size of platform data structure * @parent_idx: Index of the parent driver_info structure */ struct driver_info { const char *name; - const void *platdata; + const void *plat; #if CONFIG_IS_ENABLED(OF_PLATDATA) - unsigned short platdata_size; + unsigned short plat_size; short parent_idx; #endif }; @@ -57,7 +57,7 @@ struct driver_rt { * available). U-Boot's driver model uses device tree for configuration. * * When of-platdata is in use, U_BOOT_DEVICE() cannot be used outside of the - * dt-platdata.c file created by dtoc + * dt-plat.c file created by dtoc */ #if CONFIG_IS_ENABLED(OF_PLATDATA) && !defined(DT_PLATDATA_C) #define U_BOOT_DEVICE(__name) _Static_assert(false, \ diff --git a/include/dm/platform_data/fsl_espi.h b/include/dm/platform_data/fsl_espi.h index 812933f51c..de2307f7fb 100644 --- a/include/dm/platform_data/fsl_espi.h +++ b/include/dm/platform_data/fsl_espi.h @@ -6,7 +6,7 @@ #ifndef __fsl_espi_h #define __fsl_espi_h -struct fsl_espi_platdata { +struct fsl_espi_plat { uint flags; uint speed_hz; uint num_chipselect; diff --git a/include/dm/platform_data/lpc32xx_hsuart.h b/include/dm/platform_data/lpc32xx_hsuart.h index 9bfd62833c..6f41e0e734 100644 --- a/include/dm/platform_data/lpc32xx_hsuart.h +++ b/include/dm/platform_data/lpc32xx_hsuart.h @@ -7,11 +7,11 @@ #define _LPC32XX_HSUART_PLAT_H /** - * struct lpc32xx_hsuart_platdata - NXP LPC32xx HSUART platform data + * struct lpc32xx_hsuart_plat - NXP LPC32xx HSUART platform data * * @base: Base register address */ -struct lpc32xx_hsuart_platdata { +struct lpc32xx_hsuart_plat { unsigned long base; }; diff --git a/include/dm/platform_data/pxa_mmc_gen.h b/include/dm/platform_data/pxa_mmc_gen.h index 9875bab2cf..d15c1551f4 100644 --- a/include/dm/platform_data/pxa_mmc_gen.h +++ b/include/dm/platform_data/pxa_mmc_gen.h @@ -9,7 +9,7 @@ #include <mmc.h> /* - * struct pxa_mmc_platdata - information about a PXA MMC controller + * struct pxa_mmc_plat - information about a PXA MMC controller * * @base: MMC controller base register address */ diff --git a/include/dm/platform_data/serial_bcm283x_mu.h b/include/dm/platform_data/serial_bcm283x_mu.h index 37f5174dbf..6c77272e80 100644 --- a/include/dm/platform_data/serial_bcm283x_mu.h +++ b/include/dm/platform_data/serial_bcm283x_mu.h @@ -14,7 +14,7 @@ * * @base: Register base address */ -struct bcm283x_mu_serial_platdata { +struct bcm283x_mu_serial_plat { unsigned long base; unsigned int clock; bool skip_init; diff --git a/include/dm/platform_data/serial_coldfire.h b/include/dm/platform_data/serial_coldfire.h index ba916fece3..5e265e9087 100644 --- a/include/dm/platform_data/serial_coldfire.h +++ b/include/dm/platform_data/serial_coldfire.h @@ -7,13 +7,13 @@ #define __serial_coldfire_h /* - * struct coldfire_serial_platdata - information about a coldfire port + * struct coldfire_serial_plat - information about a coldfire port * * @base: Uart port base register address * @port: Uart port index, for cpu with pinmux for uart / gpio * baudrtatre: Uart port baudrate */ -struct coldfire_serial_platdata { +struct coldfire_serial_plat { unsigned long base; int port; int baudrate; diff --git a/include/dm/platform_data/serial_mxc.h b/include/dm/platform_data/serial_mxc.h index 86cd3bcf62..cc59eeb1dd 100644 --- a/include/dm/platform_data/serial_mxc.h +++ b/include/dm/platform_data/serial_mxc.h @@ -7,7 +7,7 @@ #define __serial_mxc_h /* Information about a serial port */ -struct mxc_serial_platdata { +struct mxc_serial_plat { struct mxc_uart *reg; /* address of registers in physical memory */ bool use_dte; }; diff --git a/include/dm/platform_data/serial_pl01x.h b/include/dm/platform_data/serial_pl01x.h index 77d96c49f0..e3d4e308a1 100644 --- a/include/dm/platform_data/serial_pl01x.h +++ b/include/dm/platform_data/serial_pl01x.h @@ -20,7 +20,7 @@ enum pl01x_type { * @skip_init: Don't attempt to change port configuration (also means @clock * is ignored) */ -struct pl01x_serial_platdata { +struct pl01x_serial_plat { unsigned long base; enum pl01x_type type; unsigned int clock; diff --git a/include/dm/platform_data/serial_pxa.h b/include/dm/platform_data/serial_pxa.h index b78bdb6409..0d7dc4c462 100644 --- a/include/dm/platform_data/serial_pxa.h +++ b/include/dm/platform_data/serial_pxa.h @@ -40,13 +40,13 @@ #endif /* - * struct pxa_serial_platdata - information about a PXA port + * struct pxa_serial_plat - information about a PXA port * * @base: Uart port base register address * @port: Uart port index, for cpu with pinmux for uart / gpio * baudrtatre: Uart port baudrate */ -struct pxa_serial_platdata { +struct pxa_serial_plat { struct pxa_uart_regs *base; int port; int baudrate; diff --git a/include/dm/platform_data/serial_sh.h b/include/dm/platform_data/serial_sh.h index 711435d8f6..69cd012fc5 100644 --- a/include/dm/platform_data/serial_sh.h +++ b/include/dm/platform_data/serial_sh.h @@ -27,7 +27,7 @@ enum sh_serial_type { * @clk_mode: Clock mode, set internal (INT) or external (EXT) * @type: Type of SCIF */ -struct sh_serial_platdata { +struct sh_serial_plat { unsigned long base; unsigned int clk; enum sh_clk_mode clk_mode; diff --git a/include/dm/platform_data/spi_coldfire.h b/include/dm/platform_data/spi_coldfire.h index 8ad8eaedfd..da514bad0d 100644 --- a/include/dm/platform_data/spi_coldfire.h +++ b/include/dm/platform_data/spi_coldfire.h @@ -10,14 +10,14 @@ #define MAX_CTAR_FIELDS 8 /* - * struct coldfire_spi_platdata - information about a coldfire spi module + * struct coldfire_spi_plat - information about a coldfire spi module * * @regs_addr: base address for module registers * @speed_hz: default SCK frequency * @mode: default SPI mode * @num_cs: number of DSPI chipselect signals */ -struct coldfire_spi_platdata { +struct coldfire_spi_plat { fdt_addr_t regs_addr; uint speed_hz; uint mode; diff --git a/include/dm/platform_data/spi_davinci.h b/include/dm/platform_data/spi_davinci.h index fbc62c262a..42a467e40b 100644 --- a/include/dm/platform_data/spi_davinci.h +++ b/include/dm/platform_data/spi_davinci.h @@ -7,7 +7,7 @@ #ifndef __spi_davinci_h #define __spi_davinci_h -struct davinci_spi_platdata { +struct davinci_spi_plat { struct davinci_spi_regs *regs; u8 num_cs; /* total no. of CS available */ }; diff --git a/include/dm/platform_data/spi_pl022.h b/include/dm/platform_data/spi_pl022.h index 63a58ee453..c5aa321291 100644 --- a/include/dm/platform_data/spi_pl022.h +++ b/include/dm/platform_data/spi_pl022.h @@ -4,7 +4,7 @@ * Quentin Schulz, Bootlin, quentin.schulz@bootlin.com * * Structure for use with U_BOOT_DEVICE for pl022 SPI devices or to use - * in ofdata_to_platdata. + * in of_to_plat. */ #ifndef __spi_pl022_h diff --git a/include/dm/root.h b/include/dm/root.h index c8d629ba9b..89afbee619 100644 --- a/include/dm/root.h +++ b/include/dm/root.h @@ -31,15 +31,15 @@ struct global_data; void dm_fixup_for_gd_move(struct global_data *new_gd); /** - * dm_scan_platdata() - Scan all platform data and bind drivers + * dm_scan_plat() - Scan all platform data and bind drivers * - * This scans all available platdata and creates drivers for each + * This scans all available plat and creates drivers for each * * @pre_reloc_only: If true, bind only drivers with the DM_FLAG_PRE_RELOC * flag. If false bind all drivers. * @return 0 if OK, -ve on error */ -int dm_scan_platdata(bool pre_reloc_only); +int dm_scan_plat(bool pre_reloc_only); /** * dm_scan_fdt() - Scan the device tree and bind drivers @@ -47,26 +47,24 @@ int dm_scan_platdata(bool pre_reloc_only); * This scans the device tree and creates a driver for each node. Only * the top-level subnodes are examined. * - * @blob: Pointer to device tree blob * @pre_reloc_only: If true, bind only nodes with special devicetree properties, * or drivers with the DM_FLAG_PRE_RELOC flag. If false bind all drivers. * @return 0 if OK, -ve on error */ -int dm_scan_fdt(const void *blob, bool pre_reloc_only); +int dm_scan_fdt(bool pre_reloc_only); /** - * dm_extended_scan_fdt() - Scan the device tree and bind drivers + * dm_extended_scan() - Scan the device tree and bind drivers * * This calls dm_scna_dft() which scans the device tree and creates a driver * for each node. the top-level subnodes are examined and also all sub-nodes * of "clocks" node. * - * @blob: Pointer to device tree blob * @pre_reloc_only: If true, bind only nodes with special devicetree properties, * or drivers with the DM_FLAG_PRE_RELOC flag. If false bind all drivers. * @return 0 if OK, -ve on error */ -int dm_extended_scan_fdt(const void *blob, bool pre_reloc_only); +int dm_extended_scan(bool pre_reloc_only); /** * dm_scan_other() - Scan for other devices diff --git a/include/dm/uclass.h b/include/dm/uclass.h index 7188304304..068e8ea8bf 100644 --- a/include/dm/uclass.h +++ b/include/dm/uclass.h @@ -65,21 +65,21 @@ struct udevice; * @child_post_probe: Called after a child in this uclass is probed * @init: Called to set up the uclass * @destroy: Called to destroy the uclass - * @priv_auto_alloc_size: If non-zero this is the size of the private data + * @priv_auto: If non-zero this is the size of the private data * to be allocated in the uclass's ->priv pointer. If zero, then the uclass * driver is responsible for allocating any data required. - * @per_device_auto_alloc_size: Each device can hold private data owned + * @per_device_auto: Each device can hold private data owned * by the uclass. If required this will be automatically allocated if this * value is non-zero. - * @per_device_platdata_auto_alloc_size: Each device can hold platform data - * owned by the uclass as 'dev->uclass_platdata'. If the value is non-zero, + * @per_device_plat_auto: Each device can hold platform data + * owned by the uclass as 'dev->uclass_plat'. If the value is non-zero, * then this will be automatically allocated. - * @per_child_auto_alloc_size: Each child device (of a parent in this + * @per_child_auto: Each child device (of a parent in this * uclass) can hold parent data for the device/uclass. This value is only * used as a fallback if this member is 0 in the driver. - * @per_child_platdata_auto_alloc_size: A bus likes to store information about + * @per_child_plat_auto: A bus likes to store information about * its children. If non-zero this is the size of this data, to be allocated - * in the child device's parent_platdata pointer. This value is only used as + * in the child device's parent_plat pointer. This value is only used as * a fallback if this member is 0 in the driver. * @ops: Uclass operations, providing the consistent interface to devices * within the uclass. @@ -98,11 +98,11 @@ struct uclass_driver { int (*child_post_probe)(struct udevice *dev); int (*init)(struct uclass *class); int (*destroy)(struct uclass *class); - int priv_auto_alloc_size; - int per_device_auto_alloc_size; - int per_device_platdata_auto_alloc_size; - int per_child_auto_alloc_size; - int per_child_platdata_auto_alloc_size; + int priv_auto; + int per_device_auto; + int per_device_plat_auto; + int per_child_auto; + int per_child_plat_auto; const void *ops; uint32_t flags; }; |