toradex: tdx-cfg-block: rework modules pid4 handling
authorVitor Soares <vitor.soares@toradex.com>
Mon, 25 Nov 2024 17:49:10 +0000 (17:49 +0000)
committerTom Rini <trini@konsulko.com>
Sat, 14 Dec 2024 02:08:59 +0000 (20:08 -0600)
commit53d5f896e99b69b7b57f3319033965790bfb999b
treeb4232f98b09a301a01576f8e89905f4bd95a9d8f
parent7917841b000d5f4732183844b34c4636c206f60e
toradex: tdx-cfg-block: rework modules pid4 handling

The module pid4 currently corresponds to the index of the toradex_module
array. If a new pid4 is introduced that does not follow the sequence of
the previous entries, it will create a gap in the array.

To address this, embed pid4 within the toradex_som structure and
implement a function to retrieve the index corresponding to pid4.

Signed-off-by: Vitor Soares <vitor.soares@toradex.com>
Acked-by: Francesco Dolcini <francesco.dolcini@toradex.com>
board/toradex/common/tdx-cfg-block.c
board/toradex/common/tdx-cfg-block.h
board/toradex/common/tdx-common.c