opensbi_1.7.bb 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. SUMMARY = "RISC-V Open Source Supervisor Binary Interface (OpenSBI)"
  2. DESCRIPTION = "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. HOMEPAGE = "https://github.com/riscv/opensbi"
  4. LICENSE = "BSD-2-Clause"
  5. LIC_FILES_CHKSUM = "file://COPYING.BSD;md5=42dd9555eb177f35150cf9aa240b61e5"
  6. require opensbi-payloads.inc
  7. inherit deploy
  8. SRCREV = "a32a91069119e7a5aa31e6bc51d5e00860be3d80"
  9. SRC_URI = "git://github.com/riscv/opensbi.git;branch=master;protocol=https"
  10. TARGET_DBGSRC_DIR = "/share/opensbi/*/generic/firmware/"
  11. TARGET_CC_ARCH += "${LDFLAGS}"
  12. RISCV_SBI_FW_TEXT_START ??= "0x80000000"
  13. EXTRA_OEMAKE += "REPRODUCIBLE=y CROSS_COMPILE=${HOST_PREFIX} ELFFLAGS="${LDFLAGS}" PLATFORM=${RISCV_SBI_PLAT} I=${D} FW_TEXT_START=${RISCV_SBI_FW_TEXT_START}"
  14. EXTRA_OEMAKE:append:toolchain-clang = " LLVM=y"
  15. # If RISCV_SBI_PAYLOAD is set then include it as a payload
  16. EXTRA_OEMAKE:append = " ${@riscv_get_extra_oemake_image(d)}"
  17. EXTRA_OEMAKE:append = " ${@riscv_get_extra_oemake_fdt(d)}"
  18. # Required if specifying a custom payload
  19. do_compile[depends] += "${@riscv_get_do_compile_depends(d)}"
  20. do_compile() {
  21. oe_runmake
  22. }
  23. do_install() {
  24. oe_runmake DESTDIR=${D} install
  25. # In the future these might be required as a dependency for other packages.
  26. # At the moment just delete them to avoid warnings
  27. rm -r ${D}/include
  28. rm -r ${D}/lib*
  29. rm -r ${D}/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/payloads
  30. }
  31. do_deploy () {
  32. install -m 755 ${D}/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_payload.* ${DEPLOYDIR}/
  33. install -m 755 ${D}/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_jump.* ${DEPLOYDIR}/
  34. install -m 755 ${D}/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_dynamic.* ${DEPLOYDIR}/
  35. }
  36. addtask deploy before do_build after do_install
  37. FILES:${PN} += "/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_jump.*"
  38. FILES:${PN} += "/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_payload.*"
  39. FILES:${PN} += "/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_dynamic.*"
  40. COMPATIBLE_HOST = "(riscv64|riscv32).*"