1def riscv_get_extra_oemake_image(d):
2    sbi_payload = d.getVar('RISCV_SBI_PAYLOAD')
3    if sbi_payload is None:
4        return ""
5
6    deploy_dir = d.getVar('DEPLOY_DIR_IMAGE')
7
8    return "FW_PAYLOAD_PATH=" + deploy_dir + "/" + sbi_payload
9
10def riscv_get_extra_oemake_fdt(d):
11    if d.getVar('RISCV_SBI_PAYLOAD') is None:
12        return ""
13    sbi_fdt = d.getVar('RISCV_SBI_FDT')
14    deploy_dir = d.getVar('DEPLOY_DIR_IMAGE')
15
16    if sbi_fdt is None:
17        return ""
18
19    return "FW_FDT_PATH=" + deploy_dir + "/" + sbi_fdt
20
21def riscv_get_do_compile_depends(d):
22    sbi_payload = d.getVar('RISCV_SBI_PAYLOAD') or ""
23    if sbi_payload == "":
24        return ""
25
26    sbi_fdt = d.getVar('RISCV_SBI_FDT') or ""
27
28    if sbi_fdt != "" and 'u-boot.bin' in sbi_payload:
29        return "virtual/kernel:do_deploy virtual/bootloader:do_deploy"
30
31    if 'linux' in sbi_payload or 'Image' in sbi_payload:
32        return "virtual/kernel:do_deploy"
33    if 'u-boot.bin' in sbi_payload:
34        return "virtual/bootloader:do_deploy"
35    if sbi_fdt != "":
36        return "virtual/kernel:do_deploy"
37
38    return ""
39