summaryrefslogtreecommitdiffstats
path: root/meta-xilinx-core/recipes-devtools/qemu/files/qemu-system-aarch64-multiarch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-xilinx-core/recipes-devtools/qemu/files/qemu-system-aarch64-multiarch')
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/files/qemu-system-aarch64-multiarch39
1 files changed, 35 insertions, 4 deletions
diff --git a/meta-xilinx-core/recipes-devtools/qemu/files/qemu-system-aarch64-multiarch b/meta-xilinx-core/recipes-devtools/qemu/files/qemu-system-aarch64-multiarch
index f310edfa..77b13aa2 100644
--- a/meta-xilinx-core/recipes-devtools/qemu/files/qemu-system-aarch64-multiarch
+++ b/meta-xilinx-core/recipes-devtools/qemu/files/qemu-system-aarch64-multiarch
@@ -35,14 +35,45 @@ if '-bootbin' in APU_args:
35if PMU_args and PLM_args: 35if PMU_args and PLM_args:
36 sys.exit("\nError: -pmu-args can not be used with -plm-args\n") 36 sys.exit("\nError: -pmu-args can not be used with -plm-args\n")
37 37
38if ('--help' in APU_args) or (not PMU_args and not PLM_args): 38help_options = ['-h', '-help', '--help']
39 print("AMD FPGA QEMU multiarch wrapper\nVersion 2024.1\n\nUsage:") 39def help(status):
40 print("AMD FPGA QEMU multiarch wrapper\nVersion 2024.2\n\nUsage:")
40 print(f" {sys.argv[0]} <APU options> [-pmu-args <pmu options>]") 41 print(f" {sys.argv[0]} <APU options> [-pmu-args <pmu options>]")
41 print(f" {sys.argv[0]} <APU options> [-plm-args <plm options>]\n") 42 print(f" {sys.argv[0]} <APU options> [-plm-args <plm options>]\n")
42 sys.exit(1) 43 if status == 0:
44 print(f"\n")
45 if set(PMU_args).intersection(set(help_options)):
46 print(f"PMU Options:\n")
47 pmu_args_s = ' '.join(PMU_args)
48 help_cmd = f'{binpath}/qemu-system-microblazeel {pmu_args_s}'
49 elif set(PLM_args).intersection(set(help_options)):
50 print(f"PLM Options:\n")
51 plm_args_s = ' '.join(PLM_args)
52 help_cmd = f'{binpath}/qemu-system-microblazeel {plm_args_s}'
53 else:
54 if not set(APU_args).intersection(set(help_options)):
55 APU_args.append('-help')
56 print(f"APU Options:\n")
57 print(f" -bootbin <boot.bin> - Use a boot.bin instead of individual firmware, device trees and bootloader\n")
58 apu_args_s = ' '.join(APU_args)
59 help_cmd = f'{binpath}/qemu-system-aarch64 {apu_args_s}'
60
61 print(f"{help_cmd}\n")
62 process = subprocess.Popen(help_cmd, shell=True, stderr=subprocess.PIPE)
63 status = process.wait()
64 sys.exit(status)
65
66if set(APU_args).intersection(set(help_options)) or set(PMU_args).intersection(set(help_options)) or set(PLM_args).intersection(set(help_options)):
67 help(0)
68
69if not PMU_args and not PLM_args:
70 help(1)
43 71
44if PMU_args: 72if PMU_args:
45 PMU_rom = PMU_args[PMU_args.index('-kernel')+1] 73 try:
74 PMU_rom = PMU_args[PMU_args.index('-kernel')+1]
75 except:
76 PMU_rom = ""
46 77
47 if not os.path.exists(PMU_rom): 78 if not os.path.exists(PMU_rom):
48 sys.exit(f'\nERROR: Missing PMU ROM: {PMU_rom}' 79 sys.exit(f'\nERROR: Missing PMU ROM: {PMU_rom}'