-
Notifications
You must be signed in to change notification settings - Fork 322
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tools: sof-ctl: Use same blob format as UCM2/cset-tlv
This change aligns the blob formats with UCM2 and sof-ctl. The binary blobs for UCM2 have an additional 8 byte header that was internally generated inside sof-ctl. This patch changes sof-ctl to expect the header to be in .txt and .bin format in the data file. The Octave scripts to export blobs for topology, sof-ctl, and UCM2 are updated to match the change. The topology embedded blobs remain as before without the header. Signed-off-by: Seppo Ingalsuo <[email protected]>
- Loading branch information
Showing
7 changed files
with
101 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
% sof_check_blob_header(blob) | ||
% | ||
% Check for correct header in bytes data. The function | ||
% errors if header is not correct. | ||
% | ||
% Input | ||
% blob - int8 type numbers data | ||
% | ||
% Output | ||
% <none> | ||
|
||
function sof_check_blob_header(blob8) | ||
|
||
% Correct size in header? | ||
blob_bytes = length(blob8); | ||
header_bytes = b2w(blob8(5:8)); | ||
if blob_bytes ~= header_bytes + 8 | ||
fprintf(1, "Error: blob header size %d does not math blob size %d\n", header_bytes, blob_bytes); | ||
fprintf(1, "Is installed sof-ctl up-to-date?\n"); | ||
error("Failed."); | ||
end | ||
|
||
% Correct command? | ||
SOF_CTRL_CMD_BINARY = 3; | ||
value = b2w(blob8(1:4)); | ||
if value ~= SOF_CTRL_CMD_BINARY | ||
fprintf(1, "Error: blob control command is not set to SOF_CTRL_CMD_BINARY.\n"); | ||
fprintf(1, "Is installed sof-ctl up-to-date?\n"); | ||
error("Failed."); | ||
end | ||
|
||
end | ||
|
||
function word =b2w(bytes) | ||
tmp = int32(bytes); | ||
word = tmp(1) + bitshift(tmp(2), 8) + bitshift(tmp(3), 16) + bitshift(tmp(4), 24); | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters