xref: /OK3568_Linux_fs/yocto/poky/meta/recipes-bsp/opensbi/opensbi_1.0.bb (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunSUMMARY = "RISC-V Open Source Supervisor Binary Interface (OpenSBI)"
2*4882a593SmuzhiyunDESCRIPTION = "OpenSBI aims to provide an open-source and extensible implementation of the RISC-V SBI specification for a platform specific firmware (M-mode) and a general purpose OS, hypervisor or bootloader (S-mode or HS-mode). OpenSBI implementation can be easily extended by RISC-V platform or System-on-Chip vendors to fit a particular hadware configuration."
3*4882a593SmuzhiyunHOMEPAGE = "https://github.com/riscv/opensbi"
4*4882a593SmuzhiyunLICENSE = "BSD-2-Clause"
5*4882a593SmuzhiyunLIC_FILES_CHKSUM = "file://COPYING.BSD;md5=42dd9555eb177f35150cf9aa240b61e5"
6*4882a593Smuzhiyun
7*4882a593Smuzhiyunrequire opensbi-payloads.inc
8*4882a593Smuzhiyun
9*4882a593Smuzhiyuninherit autotools-brokensep deploy
10*4882a593Smuzhiyun
11*4882a593SmuzhiyunSRCREV = "ce4c0188d96b2c20c2e08d24646a5e517fe15a4b"
12*4882a593SmuzhiyunSRC_URI = "git://github.com/riscv/opensbi.git;branch=master;protocol=https \
13*4882a593Smuzhiyun          "
14*4882a593Smuzhiyun
15*4882a593SmuzhiyunS = "${WORKDIR}/git"
16*4882a593Smuzhiyun
17*4882a593SmuzhiyunEXTRA_OEMAKE += "PLATFORM=${RISCV_SBI_PLAT} I=${D} FW_PIC=n CLANG_TARGET= "
18*4882a593Smuzhiyun# If RISCV_SBI_PAYLOAD is set then include it as a payload
19*4882a593SmuzhiyunEXTRA_OEMAKE:append = " ${@riscv_get_extra_oemake_image(d)}"
20*4882a593SmuzhiyunEXTRA_OEMAKE:append = " ${@riscv_get_extra_oemake_fdt(d)}"
21*4882a593Smuzhiyun
22*4882a593Smuzhiyun# Required if specifying a custom payload
23*4882a593Smuzhiyundo_compile[depends] += "${@riscv_get_do_compile_depends(d)}"
24*4882a593Smuzhiyun
25*4882a593Smuzhiyundo_install:append() {
26*4882a593Smuzhiyun	# In the future these might be required as a dependency for other packages.
27*4882a593Smuzhiyun	# At the moment just delete them to avoid warnings
28*4882a593Smuzhiyun	rm -r ${D}/include
29*4882a593Smuzhiyun	rm -r ${D}/lib*
30*4882a593Smuzhiyun	rm -r ${D}/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/payloads
31*4882a593Smuzhiyun}
32*4882a593Smuzhiyun
33*4882a593Smuzhiyundo_deploy () {
34*4882a593Smuzhiyun	install -m 755 ${D}/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_payload.* ${DEPLOYDIR}/
35*4882a593Smuzhiyun	install -m 755 ${D}/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_jump.* ${DEPLOYDIR}/
36*4882a593Smuzhiyun	install -m 755 ${D}/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_dynamic.* ${DEPLOYDIR}/
37*4882a593Smuzhiyun}
38*4882a593Smuzhiyun
39*4882a593Smuzhiyunaddtask deploy before do_build after do_install
40*4882a593Smuzhiyun
41*4882a593SmuzhiyunFILES:${PN} += "/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_jump.*"
42*4882a593SmuzhiyunFILES:${PN} += "/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_payload.*"
43*4882a593SmuzhiyunFILES:${PN} += "/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_dynamic.*"
44*4882a593Smuzhiyun
45*4882a593SmuzhiyunCOMPATIBLE_HOST = "(riscv64|riscv32).*"
46*4882a593SmuzhiyunINHIBIT_PACKAGE_STRIP = "1"
47*4882a593Smuzhiyun
48*4882a593SmuzhiyunSECURITY_CFLAGS = ""
49