Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

board: cavs15: Add a option to control signing ways #31902

Merged
merged 2 commits into from
Feb 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion boards/xtensa/intel_adsp_cavs15/tools/flash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if [ -z "$2" ]
elif [ -n "$3" ] && [ -n "$4" ]
then
echo "Signing with key " $key
west sign -d ${BUILD} -t rimage -p $4 -D $3 -- -k $2
west sign -d ${BUILD} -t rimage -p $4 -D $3 -- -k $2 --no-manifest
fi
echo ${FLASHER} -f ${FIRMWARE}
${FLASHER} -f ${FIRMWARE} || /bin/true 2>&1
2 changes: 1 addition & 1 deletion boards/xtensa/intel_adsp_cavs15/tools/lib/stream_desc.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def copy(self, data, size):
raise ValueError("Not enough buffer. allocated: %d requested: %d"
% (self.alloc_size, size))
logging.debug("Copying Data to DMA buffer")
self.buf[:] = data[:]
self.buf[:size] = data[:size]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this related or needed? Was the original version wrong?

Copy link
Collaborator Author

@KangJianX KangJianX Feb 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old version only can assign sequence of same size , buffer and data not same size, so need this change.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it changed now because you removed the manifest from the image?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is not due to remove manifest. Even if add manifest, the buffer and data size still not same, it is fix for load firmware process.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, so it isn't really related to the main topic of this commit...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, should I use a new commit for this change?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that would be easier to understand, yes. Thanks!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, do you think it's ok?


def free(self):
if self.mem:
Expand Down
10 changes: 9 additions & 1 deletion scripts/west_commands/sign.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,11 @@ def sign(self, command, build_dir, bcfg, formats):
conf_path_cmd = ['-c', conf_path]
else:
log.die('Configuration not found')
if '--no-manifest' in args.tool_args:
no_manifest = True
args.tool_args.remove('--no-manifest')
else:
no_manifest = False

sign_base = ([tool_path] + args.tool_args +
['-o', out_bin] + conf_path_cmd + ['-i', '3', '-e'] +
Expand All @@ -462,7 +467,10 @@ def sign(self, command, build_dir, bcfg, formats):
log.inf(quote_sh_list(sign_base))
subprocess.check_call(sign_base)

filenames = [out_xman, out_bin]
if no_manifest:
filenames = [out_bin]
else:
filenames = [out_xman, out_bin]
with open(out_tmp, 'wb') as outfile:
for fname in filenames:
with open(fname, 'rb') as infile:
Expand Down