summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@amd.com>2025-03-17 17:57:39 -0600
committerMark Hatle <mark.hatle@amd.com>2025-03-30 14:16:15 -0600
commit4a95d4cdccb17a5630787ed7e5097b3c3b42891a (patch)
tree0ce9e5b1f3096aa8fa273272324b5ee6a4aedbed
parenta59f9e0da23ec24d85575265ce14f520d5850de2 (diff)
downloadmeta-xilinx-4a95d4cdccb17a5630787ed7e5097b3c3b42891a.tar.gz
meta-xilinx-core: qemu-system-aarch64-multiarch: Move sanity checks
Before the user may have been forced to specify certain parameters, even if they wanted to just use --help. Move the sanity checks after the help check to avoid unnecessary warnings and errors. Signed-off-by: Mark Hatle <mark.hatle@amd.com>
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/files/qemu-system-aarch64-multiarch34
1 files changed, 17 insertions, 17 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 24b90848..e66c0fd0 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
@@ -55,23 +55,6 @@ if '-kernel' in APU_args:
55 kernel_args_idx = APU_args.index('-kernel') 55 kernel_args_idx = APU_args.index('-kernel')
56 del APU_args[kernel_args_idx:kernel_args_idx+2] 56 del APU_args[kernel_args_idx:kernel_args_idx+2]
57 57
58# The APU QEMU will hang if it does get get a -hw-dtb
59if dtb_arg and '-hw-dtb' in APU_args:
60 sys.exit(f'\nERROR: Arguments -dtb and -hw-dtb conflict, only one should be specified.')
61elif not dtb_arg and not '-hw-dtb' in APU_args:
62 sys.exit(f'\nERROR: You must specify at least a -dtb or -hw-dtb for the APU.')
63
64if mach_path_arg:
65 if not os.path.isdir(mach_path_arg):
66 sys.exit(f'\nERROR: Missing machine path for qemu: {mach_path_arg}')
67 else:
68 mach_path = os.path.realpath(mach_path_arg)
69else:
70 mach_path = tempfile.mkdtemp()
71
72if PMU_args and PLM_args:
73 sys.exit("\nError: -pmu-args can not be used with -plm-args\n")
74
75help_options = ['-h', '-help', '--help'] 58help_options = ['-h', '-help', '--help']
76def help(status): 59def help(status):
77 print("AMD FPGA QEMU multiarch wrapper\nVersion 2025.1\n\nUsage:") 60 print("AMD FPGA QEMU multiarch wrapper\nVersion 2025.1\n\nUsage:")
@@ -110,6 +93,23 @@ if set(APU_args).intersection(set(help_options)) or set(PMU_args).intersection(s
110if not PMU_args and not PLM_args: 93if not PMU_args and not PLM_args:
111 help(1) 94 help(1)
112 95
96# The APU QEMU will hang if it does get get a -hw-dtb
97if dtb_arg and '-hw-dtb' in APU_args:
98 sys.exit(f'\nERROR: Arguments -dtb and -hw-dtb conflict, only one should be specified.')
99elif not dtb_arg and not '-hw-dtb' in APU_args:
100 sys.exit(f'\nERROR: You must specify at least a -dtb or -hw-dtb for the APU.')
101
102if mach_path_arg:
103 if not os.path.isdir(mach_path_arg):
104 sys.exit(f'\nERROR: Missing machine path for qemu: {mach_path_arg}')
105 else:
106 mach_path = os.path.realpath(mach_path_arg)
107else:
108 mach_path = tempfile.mkdtemp()
109
110if PMU_args and PLM_args:
111 sys.exit("\nError: -pmu-args can not be used with -plm-args\n")
112
113if PMU_args: 113if PMU_args:
114 try: 114 try:
115 PMU_rom = PMU_args[PMU_args.index('-kernel')+1] 115 PMU_rom = PMU_args[PMU_args.index('-kernel')+1]