-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
58a5151
commit a06b054
Showing
52 changed files
with
6,781 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
*~ | ||
*.swp | ||
.venv/ | ||
build/ | ||
build*/ | ||
riscv/ | ||
riscv64/ | ||
riscv32/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
######################### | ||
## Flush SD card image ## | ||
######################### | ||
|
||
DEVICE ?= | ||
EXTEND ?= 0 | ||
FLUSH_IMAGE ?= $(BUILDROOT_BUILDDIR)/images/sdcard.img | ||
|
||
flush: | ||
ifeq ($(DEVICE),) | ||
$(call log,error,Set target device to env DEVICE) | ||
else | ||
$(call log,info,Flushing SD image) | ||
sudo dd if=$(FLUSH_IMAGE) of=$(DEVICE) bs=64k iflag=fullblock oflag=direct conv=fsync status=progress | ||
|
||
ifeq ($(EXTEND),1) | ||
$(call log,info,Extending rootfs end of the block device) | ||
echo "w" | sudo fdisk $(DEVICE) | ||
echo "- +" | sudo sfdisk -N 3 $(DEVICE) | ||
sudo e2fsck -f $(DEVICE)3 | ||
sudo resize2fs $(DEVICE)3 | ||
endif | ||
|
||
endif | ||
|
5 changes: 5 additions & 0 deletions
5
overlays/keystone/board/sifive/hifive-unmatched/extlinux.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
default buildroot | ||
label buildroot | ||
kernel /boot/Image.gz | ||
fdt /boot/hifive-unmatched-a00.dtb | ||
append root=/dev/mmcblk0p3 rootfstype=ext4 rootwait console=ttySIF0,115200 earlycon |
23 changes: 23 additions & 0 deletions
23
overlays/keystone/board/sifive/hifive-unmatched/genimage_sdcard.cfg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
image sdcard.img { | ||
hdimage { | ||
partition-table-type = "gpt" | ||
} | ||
|
||
partition u-boot-spl { | ||
image = "u-boot-spl.bin" | ||
offset = 17K | ||
partition-type-uuid = 5b193300-fc78-40cd-8002-e86c45580b47 | ||
} | ||
|
||
partition u-boot { | ||
image = "u-boot.itb" | ||
offset = 1041K | ||
partition-type-uuid = 2e54b353-1271-4842-806f-e436d6af6985 | ||
} | ||
|
||
partition rootfs { | ||
image = "rootfs.ext4" | ||
partition-type-uuid = 0fc63daf-8483-4772-8e79-3d69d8477de4 | ||
bootable = true | ||
} | ||
} |
Oops, something went wrong.