topology: utils: add DECLARE_SOF_RT_UUID() helper

Add a helper DECLARE_SOF_RT_UUID() to generate the 16 Bytes UUID string.

The input string in this format (copied from the FW source directly):
DECLARE_SOF_RT_UUID(name, uuid_macro, a, b, c,
		 d0, d1, d2, d3, d4, d5, d6, d7);

The output string should be in this format:
a6a7:a4a5:a2a3:a0a1:b2b3:b0b1:c2c3:c0c1:d00d01:d10d11:d20d21:d30d31:
d40d41:d50d51:d60d61:d70d71

e.g. for demux component, the macro usage is:
DECLARE_SOF_RT_UUID("demux", demux_uuid, 0xc4b26868, 0x1430, 0x470e,
		 0xa0, 0x89, 0x15, 0xd1, 0xc7, 0x7f, 0x85, 0x1a);

while the output will be:
68:68:b2:c4:30:14:0e:47:a0:89:15:d1:c7:7f:85:1a

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
This commit is contained in:
Keyon Jie 2020-05-28 15:59:17 +08:00 committed by Keyon Jie
parent 7811c963f5
commit 98f5de8d56
1 changed files with 12 additions and 0 deletions

View File

@ -171,5 +171,17 @@ define(`BITS_TO_BYTE',
`eval(eval($1 << 0) | eval($2 << 1) | eval($3 << 2) | eval($4 << 3)dnl
| eval($5 << 4) | eval($6 << 5) | eval($7 << 6) | eval($8 << 7))')dnl
dnl macro for component UUID declare, support copying from the FW source directly.
dnl DECLARE_SOF_RT_UUID(name, macro, a, b, c,
dnl d0, d1, d2, d3, d4, d5, d6, d7)
define(`DECLARE_SOF_RT_UUID',
`define(`$2',
`format(`%2s:%2s:%2s:%2s:%2s:%2s:%2s:%2s:%2s:%2s:%2s:%2s:%2s:%2s:%2s:%2s',
substr($3, 8, 2), substr($3, 6, 2), substr($3, 4, 2), substr($3, 2, 2),
substr($4, 4, 2), substr($4, 2, 2), substr($5, 4, 2), substr($5, 2, 2),
substr($6, 2, 2), substr($7, 2, 2), substr($8, 2, 2), substr($9, 2, 2),
substr($10, 2, 2), substr($11, 2, 2), substr($12, 2, 2), substr($13, 2, 2)
)')')
divert(0) dnl