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

Firmware handoff library hosting place #20

Open
manish-pandey-arm opened this issue Sep 29, 2023 · 13 comments
Open

Firmware handoff library hosting place #20

manish-pandey-arm opened this issue Sep 29, 2023 · 13 comments

Comments

@manish-pandey-arm
Copy link
Contributor

I want to start this thread to discuss about hosting firmware handoff library.

The initial implementation of the library has been posted in TF-A[1] as well as in OP-TEE [2] projects by [email protected] . There is also plan to implement it in U-boot project.

Considering different FW projects are adopting it, should we think of hosting this as library and all core developments can happen directly here instead of modifying various projects. This also helps us in avoiding divergence in future.

[1] https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/22215
[2] OP-TEE/optee_os#6308

@sjg20
Copy link
Contributor

sjg20 commented Sep 29, 2023

U-Boot's implementation (where this idea originally came from) is called bloblist.

There are some patches to update it for the smaller headers, but I can't link to them as patchwork is half dead ATM

@sjg20
Copy link
Contributor

sjg20 commented Sep 29, 2023

OK it came back, so the link is here:

https://patchwork.ozlabs.org/user/todo/uboot/?series=365719

I actually did a dual license thinking it might help to avoid too much duplication

@danh-arm
Copy link
Contributor

danh-arm commented Oct 5, 2023

I agree a common library implementation would be good. If we made this a common support library with a BSD-3-Clause license at tf.org, then we could do this without much extra Arm internal or tf.org approval. That license should also be usable by U-Boot. A dual licensed version is possible too but will require additional approval steps. I don't have a patchwork account but this is not really suitable upstream for a project with multiple contributors. Also, we should be careful about IP pollution until the license is agreed.

@jwerner-chromium
Copy link
Contributor

I'm not against providing a standard library implementation for those who want to use it, but I think it would important to clarify that this remains a data format specification that any project can implement on their own if they want to. There should be no implied assumption that you need to use the library to remain fully compatible, and we should make sure that all data format definitions and changes that are relevant for interoperability are always clearly explained in the paper spec, not just implemented in the library. (I would be okay with using C headers from the library as source of truth for tag format definitions, though, if that's something that we wanted to do, because I feel the GitHub markdown is quickly getting pretty unwieldy to define all these structures. We just need to make sure we draw a clear line in the source repository between the headers that are officially part of the spec and the code that just provides the example implementation.)

For hosting I would also prefer the TF.org Gerrit. GitHub has a terrible review experience.

@raymo200915
Copy link
Contributor

Currently the Transfer List codes in TF-A and OP-TEE are very close, so it will not be an issue for me to bring them to a standard library. However, U-Boot is using a way to be compatible with existing bloblist and I guess that needs some efforts to bring it to the ones that now is used in TF-A/OP-TEE. @sjg20 Please correct me if not the case.

@apalos
Copy link

apalos commented Oct 24, 2023

I am fine with the library idea. As far as I am aware U-Boot and OP-TEE should have no problems pulling it and compiling it

@sjg20
Copy link
Contributor

sjg20 commented Oct 24, 2023

There is a series to update U-Boot, here:

U-Boot impl](https://patchwork.ozlabs.org/user/todo/uboot/?series=365719

But it needs another spin now that the header-size changes has landed. I will take a look. It is dual-licensed so could perhaps provide a reference impl, except for the init code which is U-Boot-specific

@raymo200915
Copy link
Contributor

@sjg20 @apalos I would prefer to refactor U-Boot Bloblist to be a layer on top of Transfer List APIs which are currently implemented for TF-A/OP-TEE, so that we can put the most generic stuffs as a standalone library.

@sjg20
Copy link
Contributor

sjg20 commented Oct 25, 2023

You wrote a new library? Do you have a link to it?

@raymo200915
Copy link
Contributor

You wrote a new library? Do you have a link to it?

@sjg20
Currently I have an experimental branch of U-Boot that using TL for achieving DTB (This is the one I am using to test my TF-A and OP-TEE implementations).
To link here: https://github.com/raymo200915/u-boot/tree/enable_fw_handoff
The TL APIs are >90% same as the ones in TF-A/OP-TEE. So It is not a problem to put it as a common library later.
I am wondering if these APIs can be reused under Bloblist.

@sjg20
Copy link
Contributor

sjg20 commented Oct 26, 2023

Hmmm, but why not base it on the U-Boot code?

@raymo200915
Copy link
Contributor

Hmmm, but why not base it on the U-Boot code?
@sjg20
I started this in early of May of this year.
At that time I needed a quick solution to test with TF-A/OP-TEE and didn't know you were planing to do this with Bloblist.

@sjg20
Copy link
Contributor

sjg20 commented Nov 7, 2023

Oh I see. Actually this whole spec came from bloblist, just the name changed...but then we changed the headers too!

I do wonder whether it would be better to use the U-Boot code? It has tests and would save me the effort of implementing resize, etc.

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

No branches or pull requests

6 participants