2019-03-20 17:05:21 -06:00
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# opensbi
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
|
2021-04-29 01:46:32 -06:00
|
|
|
OPENSBI_VERSION = $(call qstrip,$(BR2_TARGET_OPENSBI_VERSION))
|
|
|
|
|
|
|
|
ifeq ($(OPENSBI_VERSION),custom)
|
|
|
|
# Handle custom OpenSBI tarballs as specified by the configuration
|
|
|
|
OPENSBI_TARBALL = $(call qstrip,$(BR2_TARGET_OPENSBI_CUSTOM_TARBALL_LOCATION))
|
|
|
|
OPENSBI_SITE = $(patsubst %/,%,$(dir $(OPENSBI_TARBALL)))
|
|
|
|
OPENSBI_SOURCE = $(notdir $(OPENSBI_TARBALL))
|
|
|
|
else ifeq ($(BR2_TARGET_OPENSBI_CUSTOM_GIT),y)
|
|
|
|
OPENSBI_SITE = $(call qstrip,$(BR2_TARGET_OPENSBI_CUSTOM_REPO_URL))
|
|
|
|
OPENSBI_SITE_METHOD = git
|
|
|
|
else
|
|
|
|
# Handle official OpenSBI versions
|
package: remove 'v' prefix from github-fetched packages
On Github, a large number of projects name their tag vXYZ (i.e v3.0,
v0.1, etc.). In some packages we do:
<pkg>_VERSION = v0.3
<pkg>_SITE = $(call github foo,bar,$(<pkg>_VERSION))
And in some other packages we do:
<pkg>_VERSION = 0.3
<pkg>_SITE = $(call github foo,bar,v$(<pkg>_VERSION))
I.e in one case we consider the version to be v0.3, in the other case
we consider 0.3 to be the version.
The problem with v0.3 is that when used in conjunction with
release-monitoring.org, it doesn't work very well, because
release-monitoring.org has the concept of "version prefix" and using
that they drop the "v" prefix for the version.
Therefore, a number of packages in Buildroot have a version that
doesn't match with release-monitoring.org because Buildroot has 'v0.3'
and release-monitoring.org has '0.3'.
Since really the version number of 0.3, is makes sense to update our
packages to drop this 'v'.
This commit only addresses the (common) case of github packages where
the prefix is simply 'v'. Other cases will be handled by separate
commits. Also, there are a few cases that couldn't be handled
mechanically that aren't covered by this commit.
Signed-off-by: Victor Huesca <victor.huesca@bootlin.com>
[Arnout: don't change flatbuffers, json-for-modern-cpp, libpagekite,
python-scapy3k, softether]
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2019-06-12 00:42:06 -06:00
|
|
|
OPENSBI_SITE = $(call github,riscv,opensbi,v$(OPENSBI_VERSION))
|
2021-04-29 01:46:32 -06:00
|
|
|
endif
|
|
|
|
|
2019-03-20 17:05:21 -06:00
|
|
|
OPENSBI_LICENSE = BSD-2-Clause
|
2021-05-12 02:41:03 -06:00
|
|
|
ifeq ($(BR2_TARGET_OPENSBI_LATEST_VERSION),y)
|
2019-03-20 17:05:21 -06:00
|
|
|
OPENSBI_LICENSE_FILES = COPYING.BSD
|
2021-05-12 02:41:03 -06:00
|
|
|
endif
|
2019-03-20 17:05:21 -06:00
|
|
|
OPENSBI_INSTALL_TARGET = NO
|
|
|
|
OPENSBI_INSTALL_STAGING = YES
|
|
|
|
|
2021-04-29 01:46:32 -06:00
|
|
|
ifeq ($(BR2_TARGET_OPENSBI)$(BR2_TARGET_OPENSBI_LATEST_VERSION),y)
|
|
|
|
BR_NO_CHECK_HASH_FOR += $(OPENSBI_SOURCE)
|
|
|
|
endif
|
|
|
|
|
2019-03-20 17:05:21 -06:00
|
|
|
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
|
|
|
|
|
2019-07-22 14:44:46 -06:00
|
|
|
ifeq ($(BR2_TARGET_OPENSBI_LINUX_PAYLOAD),y)
|
|
|
|
OPENSBI_DEPENDENCIES += linux
|
|
|
|
OPENSBI_MAKE_ENV += FW_PAYLOAD_PATH="$(BINARIES_DIR)/Image"
|
|
|
|
endif
|
|
|
|
|
2021-04-29 01:46:33 -06:00
|
|
|
ifeq ($(BR2_TARGET_OPENSBI_UBOOT_PAYLOAD),y)
|
|
|
|
OPENSBI_DEPENDENCIES += uboot
|
|
|
|
OPENSBI_MAKE_ENV += FW_PAYLOAD_PATH="$(BINARIES_DIR)/u-boot.bin"
|
2021-06-15 23:03:41 -06:00
|
|
|
ifeq ($(BR2_TARGET_OPENSBI_FW_FDT_PATH),y)
|
|
|
|
OPENSBI_MAKE_ENV += FW_FDT_PATH="$(BINARIES_DIR)/u-boot.dtb"
|
|
|
|
endif
|
2021-04-29 01:46:33 -06:00
|
|
|
endif
|
|
|
|
|
2019-03-20 17:05:21 -06:00
|
|
|
define OPENSBI_BUILD_CMDS
|
|
|
|
$(TARGET_MAKE_ENV) $(OPENSBI_MAKE_ENV) $(MAKE) -C $(@D)
|
|
|
|
endef
|
|
|
|
|
2021-05-04 14:51:33 -06:00
|
|
|
ifeq ($(BR2_TARGET_OPENSBI_INSTALL_DYNAMIC_IMG),y)
|
2019-03-20 17:05:21 -06:00
|
|
|
OPENSBI_INSTALL_IMAGES = YES
|
2021-05-04 14:51:33 -06:00
|
|
|
OPENSBI_FW_IMAGES += dynamic
|
2019-07-22 14:44:46 -06:00
|
|
|
endif
|
2021-05-04 14:51:33 -06:00
|
|
|
|
|
|
|
ifeq ($(BR2_TARGET_OPENSBI_INSTALL_JUMP_IMG),y)
|
|
|
|
OPENSBI_INSTALL_IMAGES = YES
|
|
|
|
OPENSBI_FW_IMAGES += jump
|
2021-04-29 01:46:33 -06:00
|
|
|
endif
|
2021-05-04 14:51:33 -06:00
|
|
|
|
|
|
|
ifeq ($(BR2_TARGET_OPENSBI_INSTALL_PAYLOAD_IMG),y)
|
|
|
|
OPENSBI_INSTALL_IMAGES = YES
|
|
|
|
OPENSBI_FW_IMAGES += payload
|
2019-07-22 14:44:46 -06:00
|
|
|
endif
|
|
|
|
|
2019-03-20 17:05:21 -06:00
|
|
|
define OPENSBI_INSTALL_IMAGES_CMDS
|
2019-07-22 14:44:46 -06:00
|
|
|
$(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
|
|
|
|
)
|
2019-03-20 17:05:21 -06:00
|
|
|
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))
|