Skip to content

Commit

Permalink
Merge pull request #1 from keystone-enclave/dev-cva6-support
Browse files Browse the repository at this point in the history
CI support for CVA6
  • Loading branch information
asyarifstudio authored Jan 9, 2024
2 parents c14f972 + cbe0dbc commit c9ba2a5
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 325 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
platform: [generic, unmatched]
platform: [generic, hifive_unmatched, cva6]
bits: [32, 64]
exclude:
# unmatched is not 32 bit
- platform: unmatched
- platform: hifive_unmatched
bits: 32

steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:
# platform that we support here
strategy:
matrix:
platform: [generic, unmatched]
platform: [generic, hifive_unmatched, cva6]
bits: [32, 64]
exclude:
# unmatched is not 32 bit
- platform: unmatched
- platform: hifive_unmatched
bits: 32

steps:
Expand Down
2 changes: 1 addition & 1 deletion overlays/keystone/configs/riscv32_cva6_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ BR2_ROOTFS_POST_BUILD_SCRIPT="$(BR2_EXTERNAL_KEYSTONE_PATH)/board/cva6/post-buil
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_KEYSTONE_PATH)/board/cva6/configs/linux32-cva6-defconfig"
BR2_PACKAGE_BUSYBOX_CONFIG="$(BR2_EXTERNAL_KEYSTONE_PATH)/board/cva6/configs/configs/busybox32-cva6.config"
BR2_PACKAGE_BUSYBOX_CONFIG="$(BR2_EXTERNAL_KEYSTONE_PATH)/board/cva6/configs/busybox32-cva6.config"
BR2_PACKAGE_DROPBEAR=y
BR2_TARGET_ROOTFS_INITRAMFS=y
BR2_TARGET_ROOTFS_EXT2=y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ BR2_TARGET_ROOTFS_EXT2_4=y
BR2_TARGET_ROOTFS_EXT2_SIZE="300M"
BR2_TARGET_OPENSBI_CUSTOM_VERSION=y
BR2_TARGET_OPENSBI_CUSTOM_VERSION_VALUE="1.1"
BR2_TARGET_OPENSBI_PLAT="hifive/unmatched"
BR2_TARGET_OPENSBI_PLAT="generic"
BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
BR2_TARGET_UBOOT_CUSTOM_VERSION=y
Expand Down
2 changes: 1 addition & 1 deletion overlays/keystone/external.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ include $(sort $(wildcard $(BR2_EXTERNAL_KEYSTONE_PATH)/boot/*/*.mk))
include $(sort $(wildcard $(BR2_EXTERNAL_KEYSTONE_PATH)/package/*/*.mk))

# U-Boot
ifeq ($(KEYSTONE_PLATFORM),unmatched)
ifeq ($(KEYSTONE_PLATFORM),hifive_unmatched)

define UBOOT_COPY_HIFIVE_SOURCES
cp -ar $(KEYSTONE)/overlays/keystone/board/sifive/hifive-unmatched/src/uboot/keystone $(@D)/arch/riscv/lib
Expand Down
2 changes: 1 addition & 1 deletion runtime/loader-binary/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set(LOADER_SOURCES loader.S loader-binary.c)
set(LOADER_LINK_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/loader.lds)

add_executable(loader ${LOADER_SOURCES})
target_link_libraries(loader rt_call ld_mm rt_util rt_loader)
target_link_libraries(loader rt_call ld_mm rt_util rt_loader gcc)
target_link_options(loader PRIVATE -static -nostdlib -T ${LOADER_LINK_SCRIPT})

add_custom_target(loader.bin ALL
Expand Down
14 changes: 10 additions & 4 deletions sm/plat/generic/objects.mk
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
# We include the default objects.mk
ifeq ($(PLATFORM),)
$(error PLATFORM not defined for SM)
endif

include $(src_dir)/platform/$(PLATFORM)/objects.mk

# And then also define custom keystone SM functionality
ifeq ($(PLATFORM),)
$(error PLATFORM not defined for SM)
endif

platform-genflags-y += "-DTARGET_PLATFORM_HEADER=\"platform/$(PLATFORM)/platform.h\""

include $(KEYSTONE_SM)/src/objects.mk
platform-objs-y += $(addprefix ../../src/,$(subst .c,.o,$(keystone-sm-sources)))

ifeq ($(KEYSTONE_PLATFORM),generic)

carray-platform_override_modules-y += generic
platform-objs-y += generic.o

else ifeq ($(KEYSTONE_PLATFORM),hifive_unmatched)

include $(KEYSTONE_SM)/plat/hifive/unmatched/objects.mk

endif
9 changes: 0 additions & 9 deletions sm/plat/hifive/unmatched/config.mk

This file was deleted.

22 changes: 0 additions & 22 deletions sm/plat/hifive/unmatched/generic.c

This file was deleted.

19 changes: 3 additions & 16 deletions sm/plat/hifive/unmatched/objects.mk
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
# We include the default objects.mk

include $(src_dir)/platform/$(PLATFORM)/objects.mk

# And then also define custom keystone SM functionality
ifeq ($(PLATFORM),)
$(error PLATFORM not defined for SM)
endif

platform-genflags-y += "-DTARGET_PLATFORM_HEADER=\"platform/$(PLATFORM)/platform.h\""

include $(KEYSTONE_SM)/src/objects.mk
platform-objs-y += $(addprefix ../../src/,$(subst .c,.o,$(keystone-sm-sources)))

carray-platform_override_modules-y += generic
platform-objs-y += generic.o

carray-platform_override_modules-y += hifive_unmatched
platform-objs-y += ../hifive/unmatched/unmatched.o
platform-cflags-y += -I$(src_dir)/platform/generic/sifive
Loading

0 comments on commit c9ba2a5

Please sign in to comment.