Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions build/meta-bsp/recipes-bsp/bsp/files/bsp_virt64.inc
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,21 @@ def __write_boot_conf(d, fs_dir, chain, machine, boot_opt):
f.write("IB_QEMU_BOOT=\"%s\"\n" % boot_opt)


# The QEMU machine of a chain without ATF. AVZ is an EL2 hypervisor, so the
# machine has to expose EL2: without it AVZ faults on its first EL2
# system-register access, which surfaces as a synchronous abort and a reset.
#
# hyp: IB_HYPERVISOR

def __virt64_machine(hyp):
machine = "virt,gic-version=2"
if hyp == "avz":
machine += ",virtualization=on"
return machine

def __do_platform_deploy(d):
# Single-ITB bootm: the plain ${IB_PLATFORM}.itb (kernel + dtb + initrd)
# and uEnv.txt are copied onto p1 by __deploy_arm_common.
# Both shapes (two-ITB AVZ boot when the ITS ends in "_avz", single-ITB
# bootm otherwise) are handled generically by __deploy_arm_common.
__deploy_arm_common(d)


Expand Down Expand Up @@ -173,12 +185,7 @@ def __do_platform_boot_chain(d):
if os.path.exists(flash_path):
os.remove(flash_path)

machine = "virt,gic-version=2"
if hyp == "avz":
# AVZ is an EL2 hypervisor, so the machine has to expose EL2.
# Without it AVZ faults on its first EL2 system-register access,
# which surfaces as a synchronous abort and a reset.
machine += ",virtualization=on"
machine = __virt64_machine(hyp)
machine += (",bootrom-drive=hd0,bootrom-offset=%d,bootrom-load=%s"
% (offset, load))

Expand All @@ -194,7 +201,7 @@ def __do_platform_boot_chain(d):
if os.path.exists(flash_path):
os.remove(flash_path)

__write_boot_conf(d, fs_dir, chain, "virt,gic-version=2",
__write_boot_conf(d, fs_dir, chain, __virt64_machine(hyp),
"-kernel u-boot/u-boot")
return

Expand Down
Loading