cbce379faf
OpenSBI is a much improved alternative to BBL (riscv-pk). Add OpenSBI support to buildroot. Signed-off-by: Alistair Francis <alistair.francis@wdc.com> [Thomas: - disable target installation, as we install nothing - enable staging installation - enable images installation only when needed - improve the comment about the staging installation] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
42 lines
1.3 KiB
Makefile
42 lines
1.3 KiB
Makefile
################################################################################
|
|
#
|
|
# opensbi
|
|
#
|
|
################################################################################
|
|
|
|
OPENSBI_VERSION = v0.3
|
|
OPENSBI_SITE = $(call github,riscv,opensbi,$(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
|
|
|
|
define OPENSBI_BUILD_CMDS
|
|
$(TARGET_MAKE_ENV) $(OPENSBI_MAKE_ENV) $(MAKE) -C $(@D)
|
|
endef
|
|
|
|
ifneq ($(OPENSBI_PLAT),)
|
|
OPENSBI_INSTALL_IMAGES = YES
|
|
define OPENSBI_INSTALL_IMAGES_CMDS
|
|
$(INSTALL) -m 0644 -D $(@D)/build/platform/$(OPENSBI_PLAT)/firmware/fw_jump.bin $(BINARIES_DIR)/fw_jump.bin
|
|
$(INSTALL) -m 0644 -D $(@D)/build/platform/$(OPENSBI_PLAT)/firmware/fw_jump.elf $(BINARIES_DIR)/fw_jump.elf
|
|
endef
|
|
endif
|
|
|
|
# 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))
|