diff options
author | Simon Glass | 2020-12-16 21:20:09 -0700 |
---|---|---|
committer | Simon Glass | 2020-12-18 20:32:21 -0700 |
commit | cd53e5bf4bba421d98eb42ec71af31b521a90c2a (patch) | |
tree | 128329e66c8f8b2e0ea84763be364a1b86871f58 /include | |
parent | d03adb4a78d18b5506350b3ac72ab2f18f1ed160 (diff) |
dm: core: Add a new sequence number for devices
At present each device has two sequence numbers, with 'req_seq' being
set up at bind time and 'seq' at probe time. The idea is that devices
can 'request' a sequence number and then the conflicts are resolved when
the device is probed.
This makes things complicated in a few cases, since we don't really know
what the sequence number will end up being. We want to honour the
bind-time requests if at all possible, but in fact the only source of
these at present is the devicetree aliases. Since we have the devicetree
available at bind time, we may as well just use it, in the hope that the
required processing will turn out to be useful later (i.e. the device
actually gets used).
Add a new 'sqq' member, the bind-time sequence number. It operates in
parallel to the old values for now. All devices get a valid sqq value,
i.e. it is never -1.
Drop an #ifdef while we are here.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/dm/device.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/dm/device.h b/include/dm/device.h index 7ada7200e3d..725e313eacd 100644 --- a/include/dm/device.h +++ b/include/dm/device.h @@ -131,6 +131,13 @@ enum { * @child_head: List of children of this device * @sibling_node: Next device in list of all devices * @flags: Flags for this device DM_FLAG_... + * @sqq: Allocated sequence number for this device (-1 = none). This is set up + * when the device is bound and is unique within the device's uclass. If the + * device has an alias in the devicetree then that is used to set the sequence + * number. Otherwise, the next available number is used. Sequence numbers are + * used by certain commands that need device to be numbered (e.g. 'mmc dev') + * + * The following two fields are deprecated: * @req_seq: Requested sequence number for this device (-1 = any) * @seq: Allocated sequence number for this device (-1 = none). This is set up * when the device is probed and will be unique within the device's uclass. @@ -156,6 +163,7 @@ struct udevice { struct list_head child_head; struct list_head sibling_node; uint32_t flags; + int sqq; int req_seq; int seq; #ifdef CONFIG_DEVRES |