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

Initial commit of rimage tool #1

Merged
merged 99 commits into from
Nov 18, 2019
Merged

Initial commit of rimage tool #1

merged 99 commits into from
Nov 18, 2019

Conversation

dcpleung
Copy link
Contributor

@dcpleung dcpleung commented Nov 12, 2019

This is the initial commit to add the rimage tool. Zephyr is in the process of enabling a BSP for the APL DSP on UP Squared board, which requires rimage to build the firmware. Discussion with @lgirdwood resulted in this work. Note that the files under src/include/sof/ are only needed when building without the SOF tree. If the SOF tree path is passed to configure with --with-sof-source=<path>, the same-name files in the SOF tree are used instead.

This utilizes autotool and thus the tool can be built with configure/make.

@dbaluta
Copy link
Contributor

dbaluta commented Nov 12, 2019

@dcpleung is it possible to also import the git history from old repo?

@dcpleung
Copy link
Contributor Author

@dbaluta Let me try.

@cujomalainey
Copy link
Member

Only ways I can think of doing that is either copying the whole history and deleting everything else or manually cherry-picking the history of the rimage folder and handling backports where necessary

@lgirdwood
Copy link
Member

I dont think it's a big deal if history cannot be easily preserved here as it will still be in the main sof repo master branch.

lrgirdwo and others added 24 commits November 12, 2019 09:17
rimage is being moved from tools repo to sof repo since there is now a
cyclic dependency between both repos and sof needs rimage for it's
build.

Signed-off-by: Liam Girdwood <[email protected]>
Make sure we validate all module sections against each other.

Signed-off-by: Liam Girdwood <[email protected]>
Section end was not checked. Now fixed. Added more error output to
identify.

Signed-off-by: Liam Girdwood <[email protected]>
Add unsigned firmware support, that can directly use the FW or sign it
with other tools.

Signed-off-by: Pan Xiuli <[email protected]>
make sure no manifest segments collide with each other and fail if they
do.

Signed-off-by: Liam Girdwood <[email protected]>
The actual text size will change and the hard code base_fw_text_size_fixup
could not fit the changing size. We should get the fixup size from the
module info just from the memory mapping.

Signed-off-by: Pan Xiuli <[email protected]>
text_offset was added to an immutable ROM structure that would break
some tools and cause instability. Fix this by creating a new structure
for rimage manifest data that can be modified without breaking the ROM
ABI.

Signed-off-by: Liam Girdwood <[email protected]>
xcc has more strict rules than gcc:
- Add missing sections to linker scripts
- Fix compile warnings
- Extend memory enabling timeout to infinite (too small delay for xcc)

Signed-off-by: Tomasz Lauda <[email protected]>

# Conflicts:
#	src/platform/apollolake/platform.c
#	src/platform/cannonlake/platform.c
Display the name of each ELF section to aid build and debug.

Signed-off-by: Liam Girdwood <[email protected]>
Currently rimage only supports building ELF images with know TEXT, DATA
and BSS addresses. This patch adds support to build runtime relocatable
modules that can be loaded linked into the base SOF FW at runtime.

Signed-off-by: Liam Girdwood <[email protected]>
The variable "i" shouldn't be used.

Signed-off-by: Yan Wang <[email protected]>
Openssl 1.1.0 is latest stable version with minor API differences.

Signed-off-by: Liam Girdwood <[email protected]>
If keyname can not be open, error message should output keyname insert
of tmp path.

Signed-off-by: Pan Xiuli <[email protected]>
Add compatibility support for openssl 1.0.2 support alongsid with
openssl 1.1.0

References:
https://wiki.openssl.org/index.php/OpenSSL_1.1.0_Changes
Compatibility Layer

Signed-off-by: Pan Xiuli <[email protected]>
Now correct FW version is included into binary.

Signed-off-by: Tomasz Lauda <[email protected]>
This patch allows rimage to sign FW binaries using MEU tool.
Paths to MEU and private key have to be provided during config step.

Signed-off-by: Tomasz Lauda <[email protected]>
path may return out the function from rimage->key_name.
Switch the usage for local variable to avoid this bug.

Signed-off-by: Pan Xiuli <[email protected]>
Added icelake platform to platforms.
Updated rimage to support icelake.
Updated autoconf and automake files.

Signed-off-by: Janusz Jankowski <[email protected]>
.static_log_entries section is extracted to logs dictionary
to remove xtensa toolchain dependency from logs parser.

Signed-off-by: ArturX Kloniecki <[email protected]>
jajanusz and others added 14 commits November 12, 2019 09:24
Signed-off-by: Janusz Jankowski <[email protected]>
Add function writing manifest v2.5 for MEU.

Signed-off-by: Janusz Jankowski <[email protected]>
Signed-off-by: Janusz Jankowski <[email protected]>
JSL should have almost same config as ICL, but they should
have different fw name.

Signed-off-by: Pan Xiuli <[email protected]>
This renames the rimage directory to "src". This also moves
the header files into src/include/rimage. This is in
preparation to allow rimage to be built outside of SOF tree,
and it requires some SOF header files. Moving headers under
src/include/rimage makes it obvious that these headers are
for rimage.

Signed-off-by: Daniel Leung <[email protected]>
These headers are required for building rimage outside of
the SOF source tree as a standalone tool.

Signed-off-by: Daniel Leung <[email protected]>
The #define in version.h will be passed as command line
argument instead, as the tool has to build on its own.

Signed-off-by: Daniel Leung <[email protected]>
This removes the macro PEM_KEY_PREFIX and make rimage to always
require key to be specified in command line.

Signed-off-by: Daniel Leung <[email protected]>
Signed-off-by: Daniel Leung <[email protected]>
Since rimage is no longer built with the SOF code, the firmware
version (SOF_MAJOR and SOF_MINOR) and build ID (SOF_BUILD) are
no longer defined during build. So these needs to be passed as
command line arguments.

Signed-off-by: Daniel Leung <[email protected]>
This adds the necessary configuration files to enable
autotools for configure/make files generation.

Signed-off-by: Daniel Leung <[email protected]>
This adds the files created after running `autoreconf -i`.
This allows the project to be 'configure'-d and built.

Signed-off-by: Daniel Leung <[email protected]>
This adds intructions to build the rimage tool.

Signed-off-by: Daniel Leung <[email protected]>
@dcpleung
Copy link
Contributor Author

Updated it with history of rimage (files under SOF's rimage/).

@cujomalainey
Copy link
Member

I don't see the keys committed here, will they be passed in by the builders?

@dbaluta
Copy link
Contributor

dbaluta commented Nov 12, 2019

@dcpleung thanks for taking care of this! Looks good to me.

@dcpleung
Copy link
Contributor Author

@cujomalainey The keys are still in the SOF repo, and will be passed as command line arguments.

@cujomalainey
Copy link
Member

@dcpleung thanks :) what is the motivation for splitting this out of the SOF repo? I thought the reason for merging the SOFT repo was so we had less issues with keeping ABIs in sync across tools, this seems like a step backward since there are copies of the IPC ABI in these commits.

@dcpleung
Copy link
Contributor Author

Zephyr is in the process of enabling a BSP for the APL DSP on UP Squared board, which requires rimage to build the firmware. Discussion with @lgirdwood resulted in this work. Note that the files under src/include/sof/ are only needed when building without the SOF tree. If the SOF tree path is passed to configure with --with-sof-source=<path>, the same-name files in the SOF tree are used instead.

@cujomalainey
Copy link
Member

Sounds good to me, thanks for the information

@plbossart
Copy link
Member

Zephyr is in the process of enabling a BSP for the APL DSP on UP Squared board, which requires rimage to build the firmware. Discussion with @lgirdwood resulted in this work. Note that the files under src/include/sof/ are only needed when building without the SOF tree. If the SOF tree path is passed to configure with --with-sof-source=<path>, the same-name files in the SOF tree are used instead.

Please add this to the PR description...

my concern is that once you have rimage, you'll want to use actual code from the SOF tree, so what's the plan here? The last split and merge of SOFT was a nightmare, I'd like to make sure we have a direction that's well agreed on. Any solution that impacts our ability to bisect is a NAK.

@lgirdwood lgirdwood merged commit f4e515b into thesofproject:master Nov 18, 2019
@dcpleung dcpleung deleted the standalone_rimage branch November 18, 2019 17:22
@jajanusz
Copy link
Contributor

Why was it merged? I see there a bit of mess. Fe. 2 buildsystems - automake and cmake, we can go with just cmake as both sof and zephyr use it.

@plbossart
Copy link
Member

Why was it merged? I see there a bit of mess. Fe. 2 buildsystems - automake and cmake, we can go with just cmake as both sof and zephyr use it.

agree.

@lgirdwood
Copy link
Member

I'm guessing this is an issue for Windows ?

Userspace tooling is traditionally built with autotools since it has no extra dependencies and easy for the distros. I've no objections to cmake if someone wants to copy the current camke file over.

@marc-hb
Copy link
Contributor

marc-hb commented Sep 19, 2020

Anyone looking for the rimage history and hitting the first, b537522 commit in this repo (a.k.a. the "end of the road") must continue to https://github.com/thesofproject/soft/commits/72d797d9ddae7 (and not to https://github.com/thesofproject/tools which is not a thing, thanks @ranj063 for the tip)

Only ways I can think of doing that is either copying the whole history and deleting everything else or manually cherry-picking the history of the rimage folder and handling backports where necessary

I remember git filter-branch could do pretty much anything - including shooting in an unlimited number feet. Now I see git help filter-branch recommends git filter-repo instead, never tried the new one.

@marc-hb
Copy link
Contributor

marc-hb commented Sep 7, 2023

Anyone looking for the rimage history [...] must continue to https://github.com/thesofproject/soft/commits/72d797d9ddae7

Funny enough I just discovered that this sof-tools.git history is also in sof.git thanks to @cujomalainey (thanks!)

Complete story at

... where merging rimage back is discussed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.