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

Source code for generating fip.bin? #74

Open
silvanshade opened this issue Mar 7, 2024 · 2 comments
Open

Source code for generating fip.bin? #74

silvanshade opened this issue Mar 7, 2024 · 2 comments

Comments

@silvanshade
Copy link

Is the source code available for generating the firmware/fip.bin?

I am trying to put together a custom bootloader and would like to be able to reproduce this file from source if possible.

I also created an issue asking for more information about fip.bin in the sophgo-doc repository:

sophgo/sophgo-doc#69

The closest thing I have been able to find regarding the fip.bin is from the cv18xx documentation:

Section 3.3.1 Generate Image:

Please refer to <U-boot Porting Development Guide> to generate FIP.bin image.
Section 3.3 Compile U-boot

Since the native u-boot compiled u-boot.bin cannot be burned directly into FLASH, we adopt
the Firmware Image Package (FIP) method in ARM Trusted Firmware Design to encapsulate
uboot.bin in fip.bin. fip_spl.bin contains several images that need to be loaded during the fast
boot process.

I notice that there is a u-boot repository with an sg2042-dev branch:

https://github.com/sophgo/u-boot/tree/sg2042-dev

But I'm not sure if this is where the firmware/fip.bin in this repository is being generated from.

Any information would be appreciated.

@michaelrommel
Copy link

michaelrommel commented Mar 25, 2024

For what it's worth, if you have a look at the github actions workflow, there are artifacts generated by those steps. If you download e.g. sophgo-bootloader-single-sg2042-master (https://github.com/sophgo/bootloader-riscv/actions/runs/8414100858) you will find an .img therein. If you mount that, there is an actual fip.bin file contained. Maybe that is what you are looking for, if yes, then the steps in the workflow tell you, how it's been created. If you have already figured that out, I'm sorry, I am very new to this risc-v businees and just try to get my own Pioneer board running...

@silvanshade
Copy link
Author

Yeah, I've looked at that.

In fact, I created from scratch a Nix flake for building the BSP and bootloader which follows the similar procedure, and copies the fip.bin at this step here.

Unfortunately I just have to take the fip.bin as the binary blob from this repository because, even if you dig into the build scripts here, there's no mention of how it's generated.

Looking at efforts to run NixOS on the MilkV Duo show something similar, where they have to package the fip.bin as a prebuilt artifact here.

Anyway, still hoping the sources for this can be provided although I'm not sure how likely that is to happen.

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

2 participants