diff options
author | Tom Rini <trini@konsulko.com> | 2018-11-16 08:37:50 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2018-11-16 08:37:50 -0500 |
commit | 1d6edcbfed2af33c748f2beb399810a0441888da (patch) | |
tree | fe88d63e5ef1dbe1915f90e02429e8b6934859da /include/dm | |
parent | f6206f8587fc7ec82a57dbbeb5de0f94b3c2ef49 (diff) | |
parent | 4c6e27f63c88d065a98f438085dfc36af47d3a23 (diff) |
Merge tag 'pull-14nov18' of git://git.denx.de/u-boot-dm
- virtio implementation and supporting patches
- DM_FLAG_PRE_RELOC fixes
- regmap improvements
- minor buildman and sandbox things
Diffstat (limited to 'include/dm')
-rw-r--r-- | include/dm/device-internal.h | 4 | ||||
-rw-r--r-- | include/dm/lists.h | 9 | ||||
-rw-r--r-- | include/dm/root.h | 17 | ||||
-rw-r--r-- | include/dm/test.h | 1 | ||||
-rw-r--r-- | include/dm/uclass-id.h | 1 | ||||
-rw-r--r-- | include/dm/uclass.h | 4 | ||||
-rw-r--r-- | include/dm/util.h | 27 |
7 files changed, 48 insertions, 15 deletions
diff --git a/include/dm/device-internal.h b/include/dm/device-internal.h index 02ac4c7952..ee2b24a62a 100644 --- a/include/dm/device-internal.h +++ b/include/dm/device-internal.h @@ -74,8 +74,8 @@ int device_bind_with_driver_data(struct udevice *parent, * tree. * * @parent: Pointer to device's parent - * @pre_reloc_only: If true, bind the driver only if its DM_INIT_F flag is set. - * If false bind the driver always. + * @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 * @devp: if non-NULL, returns a pointer to the bound device * @return 0 if OK, -ve on error diff --git a/include/dm/lists.h b/include/dm/lists.h index 13d1516a12..810e244d9e 100644 --- a/include/dm/lists.h +++ b/include/dm/lists.h @@ -39,8 +39,8 @@ struct uclass_driver *lists_uclass_lookup(enum uclass_id id); * each one. The devices will have @parent as their parent. * * @parent: parent device (root) - * @early_only: If true, bind only drivers with the DM_INIT_F flag. If false - * bind all drivers. + * @pre_reloc_only: If true, bind only drivers with the DM_FLAG_PRE_RELOC flag. + * If false bind all drivers. */ int lists_bind_drivers(struct udevice *parent, bool pre_reloc_only); @@ -53,10 +53,13 @@ int lists_bind_drivers(struct udevice *parent, bool pre_reloc_only); * @parent: parent device (root) * @node: device tree node to bind * @devp: if non-NULL, returns a pointer to the bound device + * @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 device was bound, -EINVAL if the device tree is invalid, * other -ve value on error */ -int lists_bind_fdt(struct udevice *parent, ofnode node, struct udevice **devp); +int lists_bind_fdt(struct udevice *parent, ofnode node, struct udevice **devp, + bool pre_reloc_only); /** * device_bind_driver() - bind a device to a driver diff --git a/include/dm/root.h b/include/dm/root.h index 2b9c6da416..c8d629ba9b 100644 --- a/include/dm/root.h +++ b/include/dm/root.h @@ -48,8 +48,8 @@ int dm_scan_platdata(bool pre_reloc_only); * the top-level subnodes are examined. * * @blob: Pointer to device tree blob - * @pre_reloc_only: If true, bind only drivers with the DM_FLAG_PRE_RELOC - * flag. If false bind all drivers. + * @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); @@ -62,8 +62,8 @@ int dm_scan_fdt(const void *blob, bool pre_reloc_only); * of "clocks" node. * * @blob: Pointer to device tree blob - * @pre_reloc_only: If true, bind only drivers with the DM_FLAG_PRE_RELOC - * flag. If false bind all drivers. + * @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); @@ -76,8 +76,9 @@ int dm_extended_scan_fdt(const void *blob, bool pre_reloc_only); * programmaticaly. They should do this by calling device_bind() on each * device. * - * @pre_reloc_only: If true, bind only drivers with the DM_FLAG_PRE_RELOC - * flag. If false bind all drivers. + * @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_other(bool pre_reloc_only); @@ -88,8 +89,8 @@ int dm_scan_other(bool pre_reloc_only); * then scans and binds available devices from platform data and the FDT. * This calls dm_init() to set up Driver Model structures. * - * @pre_reloc_only: If true, bind only drivers with the DM_FLAG_PRE_RELOC - * flag. If false bind all drivers. + * @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_init_and_scan(bool pre_reloc_only); diff --git a/include/dm/test.h b/include/dm/test.h index 83418eb482..07385cd531 100644 --- a/include/dm/test.h +++ b/include/dm/test.h @@ -69,6 +69,7 @@ struct dm_test_priv { int op_count[DM_TEST_OP_COUNT]; int uclass_flag; int uclass_total; + int uclass_postp; }; /** diff --git a/include/dm/uclass-id.h b/include/dm/uclass-id.h index 269a2c6e72..c91dca1f82 100644 --- a/include/dm/uclass-id.h +++ b/include/dm/uclass-id.h @@ -96,6 +96,7 @@ enum uclass_id { UCLASS_VIDEO_BRIDGE, /* Video bridge, e.g. DisplayPort to LVDS */ UCLASS_VIDEO_CONSOLE, /* Text console driver for video device */ UCLASS_VIDEO_OSD, /* On-screen display */ + UCLASS_VIRTIO, /* VirtIO transport device */ UCLASS_W1, /* Dallas 1-Wire bus */ UCLASS_W1_EEPROM, /* one-wire EEPROMs */ UCLASS_WDT, /* Watchdot Timer driver */ diff --git a/include/dm/uclass.h b/include/dm/uclass.h index eebf2d5614..4ef0d0f0c0 100644 --- a/include/dm/uclass.h +++ b/include/dm/uclass.h @@ -61,7 +61,8 @@ struct udevice; * @post_probe: Called after a new device is probed * @pre_remove: Called before a device is removed * @child_post_bind: Called after a child is bound to a device in this uclass - * @child_pre_probe: Called before a child is probed in this uclass + * @child_pre_probe: Called before a child in this uclass is probed + * @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 @@ -94,6 +95,7 @@ struct uclass_driver { int (*pre_remove)(struct udevice *dev); int (*child_post_bind)(struct udevice *dev); int (*child_pre_probe)(struct udevice *dev); + int (*child_post_probe)(struct udevice *dev); int (*init)(struct uclass *class); int (*destroy)(struct uclass *class); int priv_auto_alloc_size; diff --git a/include/dm/util.h b/include/dm/util.h index 898822e445..9ff6531d1b 100644 --- a/include/dm/util.h +++ b/include/dm/util.h @@ -55,7 +55,7 @@ static inline void dm_dump_devres(void) * There are 3 settings currently in use * - * - u-boot,dm-pre-reloc: legacy and indicates any of TPL or SPL - * Existing platforms only use it to indicate nodes needee in + * Existing platforms only use it to indicate nodes needed in * SPL. Should probably be replaced by u-boot,dm-spl for * existing platforms. * @blob: devicetree @@ -65,4 +65,29 @@ static inline void dm_dump_devres(void) */ bool dm_fdt_pre_reloc(const void *blob, int offset); +/** + * Check if an of node should be or was bound before relocation. + * + * Devicetree nodes can be marked as needed to be bound + * in the loader stages via special devicetree properties. + * + * Before relocation this function can be used to check if nodes + * are required in either SPL or TPL stages. + * + * After relocation and jumping into the real U-Boot binary + * it is possible to determine if a node was bound in one of + * SPL/TPL stages. + * + * There are 3 settings currently in use + * - + * - u-boot,dm-pre-reloc: legacy and indicates any of TPL or SPL + * Existing platforms only use it to indicate nodes needed in + * SPL. Should probably be replaced by u-boot,dm-spl for + * existing platforms. + * @node: of node + * + * Returns true if node is needed in SPL/TL, false otherwise. + */ +bool dm_ofnode_pre_reloc(ofnode node); + #endif |