kumquat-buildroot/boot/opensbi/opensbi.mk
Mark Corbin a517093ea9 boot/opensbi: bump to version 0.8
The OpenSBI platform 'qemu/virt' has been removed in v0.8. Builds for
the QEMU 'virt' machine can use the 'generic' platform instead.

Tested with qemu_riscv32_virt_defconfig and
qemu_riscv64_virt_defconfig using Buildroot host-qemu 5.0.0.

Signed-off-by: Mark Corbin <mark@dibsco.co.uk>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
[yann.morin.1998@free.fr: two spaces in hash file]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-06-24 21:29:18 +02:00

56 lines
1.6 KiB
Makefile

################################################################################
#
# opensbi
#
################################################################################
OPENSBI_VERSION = 0.8
OPENSBI_SITE = $(call github,riscv,opensbi,v$(OPENSBI_VERSION))
OPENSBI_LICENSE = BSD-2-Clause
OPENSBI_LICENSE_FILES = COPYING.BSD
OPENSBI_INSTALL_TARGET = NO
OPENSBI_INSTALL_STAGING = YES
OPENSBI_MAKE_ENV = \
CROSS_COMPILE=$(TARGET_CROSS)
OPENSBI_PLAT = $(call qstrip,$(BR2_TARGET_OPENSBI_PLAT))
ifneq ($(OPENSBI_PLAT),)
OPENSBI_MAKE_ENV += PLATFORM=$(OPENSBI_PLAT)
endif
ifeq ($(BR2_TARGET_OPENSBI_LINUX_PAYLOAD),y)
OPENSBI_DEPENDENCIES += linux
OPENSBI_MAKE_ENV += FW_PAYLOAD_PATH="$(BINARIES_DIR)/Image"
endif
define OPENSBI_BUILD_CMDS
$(TARGET_MAKE_ENV) $(OPENSBI_MAKE_ENV) $(MAKE) -C $(@D)
endef
ifneq ($(OPENSBI_PLAT),)
OPENSBI_INSTALL_IMAGES = YES
OPENSBI_FW_IMAGES += jump dynamic
ifeq ($(BR2_TARGET_OPENSBI_LINUX_PAYLOAD),y)
OPENSBI_FW_IMAGES += payload
endif
endif
define OPENSBI_INSTALL_IMAGES_CMDS
$(foreach f,$(OPENSBI_FW_IMAGES),\
$(INSTALL) -m 0644 -D $(@D)/build/platform/$(OPENSBI_PLAT)/firmware/fw_$(f).bin \
$(BINARIES_DIR)/fw_$(f).bin
$(INSTALL) -m 0644 -D $(@D)/build/platform/$(OPENSBI_PLAT)/firmware/fw_$(f).elf \
$(BINARIES_DIR)/fw_$(f).elf
)
endef
# libsbi.a is not a library meant to be linked in user-space code, but
# with bare metal code, which is why we don't install it in
# $(STAGING_DIR)/usr/lib
define OPENSBI_INSTALL_STAGING_CMDS
$(INSTALL) -m 0644 -D $(@D)/build/lib/libsbi.a $(STAGING_DIR)/usr/share/opensbi/libsbi.a
endef
$(eval $(generic-package))