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 #386

Merged
merged 21 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
*~
*.swp
.venv/
build/
build*/
riscv/
riscv64/
riscv32/
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ include mkutils/log.mk
BUILDROOT_CONFIGFILE ?= qemu_riscv$(KEYSTONE_BITS)_virt_defconfig
ifeq ($(KEYSTONE_PLATFORM),mpfs)
EXTERNALS += microchip
else ifeq ($(KEYSTONE_PLATFORM),unmatched)
BUILDROOT_CONFIGFILE = riscv64_hifive_unmatched_defconfig
endif

# Highest priority external
Expand Down Expand Up @@ -114,3 +116,4 @@ linux-configure: $(BUILDROOT_BUILDDIR)/.config
#################

-include mkutils/plat/$(KEYSTONE_PLATFORM)/run.mk

25 changes: 25 additions & 0 deletions mkutils/plat/unmatched/run.mk
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 overlays/keystone/board/sifive/hifive-unmatched/extlinux.conf
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
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
}
}
Loading