Skip to content

Commit

Permalink
Fix unmatched support
Browse files Browse the repository at this point in the history
  • Loading branch information
grg-haas committed Jan 8, 2024
1 parent dea8b19 commit cbe0dbc
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 319 deletions.
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
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
260 changes: 0 additions & 260 deletions sm/plat/hifive/unmatched/sifive/fu740.c

This file was deleted.

6 changes: 0 additions & 6 deletions sm/plat/hifive/unmatched/sifive/objects.mk

This file was deleted.

13 changes: 13 additions & 0 deletions sm/plat/hifive/unmatched/unmatched.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include "fu740.c"
#include "sm.h"

static int unmatched_final_init(bool cold_boot, const struct fdt_match *match) {
sm_init(cold_boot);
return sifive_fu740_final_init(cold_boot, match);
}

const struct platform_override hifive_unmatched = {
.match_table = sifive_fu740_match,
.tlbr_flush_limit = sifive_fu740_tlbr_flush_limit,
.final_init = unmatched_final_init
};

0 comments on commit cbe0dbc

Please sign in to comment.