]> git.baikalelectronics.ru Git - uboot.git/commit
dtoc: Order the structures internally by name
authorSimon Glass <sjg@chromium.org>
Sat, 3 Oct 2020 17:31:25 +0000 (11:31 -0600)
committerSimon Glass <sjg@chromium.org>
Thu, 29 Oct 2020 20:42:17 +0000 (14:42 -0600)
commit4bcc62d60e323d7a977cc21b1d23c556a3944176
treea93247e2c9fb196d57a2b705f3fec4d3440d7fc6
parent1b2b89cf22a1f6295744bacf191e2ca4ad981372
dtoc: Order the structures internally by name

At present the structures are written in name order, but parents have to
be written before their children, so the file does not end up being in
order. The order of nodes in _valid_nodes matches the order of the
devicetree.

Update the code so that _valid_nodes is in sorted order, by C name of
the structure. This allows us to assign a sequential ordering to each
U_BOOT_DEVICE() declaration.

U-Boot's linker lists are also ordered alphabetically, which means that
the order in the driver_info list will match the order used by dtoc. This
defines an index ('idx') for the U_BOOT_DEVICE declarations. They appear
in alphabetical order, numbered from 0 in _valid_nodes and in the
driver_info linker list.

Add a comment against each declaration, showing the idx value.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/dtoc/dtb_platdata.py
tools/dtoc/test_dtoc.py