[PATCH v3 04/28] dm: core: Add a new sequence number for devices

Simon Glass sjg at chromium.org
Sat Dec 19 17:40:37 CET 2020


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 at chromium.org>
---

(no changes since v2)

Changes in v2:
- Give all devices a sequence number
- Drop uclass_alloc_all_seqs() and GD_FLG_DM_NO_SEQ flag

 drivers/core/device.c | 22 ++++++++++++++++------
 drivers/core/root.c   |  8 +++++---
 include/dm/device.h   |  8 ++++++++
 3 files changed, 29 insertions(+), 9 deletions(-)

Applied to u-boot-dm/next, thanks!


More information about the U-Boot mailing list