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

Support for HiFive Unmatched #384

Open
Nanamiiiii opened this issue Nov 9, 2023 · 2 comments
Open

Support for HiFive Unmatched #384

Nanamiiiii opened this issue Nov 9, 2023 · 2 comments

Comments

@Nanamiiiii
Copy link
Contributor

Hi, everyone.

I recently ported keystone to HiFive Unmatched in the course of my work.
Using the buildroot system, SD card image that work with Unmatched can be created with a single make command. The image includes U-Boot SPL, SM, U-Boot Proper and rootfs.
It is also configured to apply some of the patches included in freedom-u-sdk and meta-sifive.
U-Boot does not implement secureboot for keystone like bootrom does here, but I have implemented the equivalent to U-Boot in the past, and I can also provide this.

Is there a demand for this porting? I would like to contribute if necessary.

Thanks.

@grg-haas
Copy link
Collaborator

grg-haas commented Nov 9, 2023

Hi @Nanamiiiii ,

We'd definitely be interested in this! Please feel free to open a PR, I would love to take a look

Gregor

@Nanamiiiii
Copy link
Contributor Author

Okay.
I am currently tuning the build configuration and will issue a PR as soon as it is complete.

dayeol pushed a commit that referenced this issue Dec 13, 2023
This PR adds board support for HiFive Unmatched. (#384)
You can generate SD card image for unmatched using buildroot by single
`make` command.
It will not be available for production, but it will allow for easy
testing.

I checked that almost all example runs correctly, but only `attestor.ke`
throw runtime error bacause the package does not include firmware image
(`fw_jump.elf`) correctly. Same thing is happening with qemu target.

## New items/Changes
- Add buildroot config for unmatched in `overlays/keystone/configs`
- Add board specific configs/patches in `overlays/keystone/board`
- Some patches in `freedom-u-sdk` & `meta-sifive` (2023.08) are included
- Implement secureboot same as bootrom in u-boot. This is applied via a
patch.
- Unmatched's platform overrides in upstream OpenSBI is added to
`sm/plat`
- Add make target to flush SD card image
- Other minor modifications

## Known issue
Porting issue mentioned
[here](https://groups.google.com/g/keystone-enclave-forum/c/6vnr6pWPZjw/m/HBeq4a5OBAAJ)
is still remaining.
With default `SMM_SIZE` (`0x200000`), machine hangs when switching to
S-Mode entering u-boot proper (when function `sbi_hart_switch_mode` is
called).

In this PR, change `SMM_SIZE` to `0x80000` same as sbi domain region by
passing compile flag for unmatched target. This is temporary fix.

## Remarks
FU740 has waymasks same as FU540. Waymasking implemented for FU540 can
be ported to FU740, I think.
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