<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p>Yes, the ultra96 BSP generates a 32-bit executable. QEMU starts
its CPUs in 64-bit mode. You would need a small piece of 64-bit
AArch64 assembly to start on the CPU which would jump into the
32-bit executable. It could even theoretically be inlined into
start.S as raw machine code.</p>
<p><br>
</p>
<p>Kinsey<br>
</p>
<div class="moz-cite-prefix">On 4/23/2021 03:56, Alireza Banejad
wrote:<br>
</div>
<blockquote type="cite" cite="mid:CADH3hnJ4TsoZCJY4q-uT73er9kvLA-bmxwZ9nuf4Yd2eat8EMQ@mail.gmail.com">
<div dir="ltr">thank you for your response,
<div>i understood your second option but I somewhat haven't
understood your first option. isn't the code written for the
ultra96 BSP already meant to be 32-bit?</div>
<div>would you give me a further explanation?</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Thu, Apr 22, 2021 at 8:29
PM Kinsey Moore <<a href="mailto:kinsey.moore@oarcorp.com" moz-do-not-send="true">kinsey.moore@oarcorp.com</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On
4/22/2021 08:47, Alireza Banejad wrote:<br>
> Hello<br>
> I want to know could I run applications for the ultra96
bsp in qemu?<br>
> I tried the qemu-system-arm with the virt machine and cpu
specified as <br>
> cortex-a7 yet I don't get anything<br>
> I also tried the qemu-system-aarch64 specifying the
machine as <br>
> xlnx-zcu102 and it still couldn't run the application.<br>
> BTW the application is just the hello sample from the
testsuite<br>
> In reality I actually could run applications that were
built with the <br>
> xilinx_zynqmp_ultra96 on a actual zcu102 board<br>
> But I don't understand why this doesn't happen in qemu<br>
> I don't have the board right now that why I need to test
my <br>
> applications in qemu<br>
> Long story short, how can I run my applications built for
<br>
> xilinx_zynqmp_ultra96 in qemu??<br>
><br>
The issue that you're having is that the ARM
xilinx_zynqmp_ultra96 BSP <br>
is designed to run on the Ultrascale+ ZynqMP chip in 32-bit
mode instead <br>
of 64-bit mode. qemu-system-aarch64 is the correct QEMU to
use, but it <br>
starts in EL1/AArch64 mode by default. I haven't seen a way to
directly <br>
start AArch32/ARMv7 code on the virtualized Cortex-A53 CPU,
but on real <br>
hardware it would be controlled by the AA64nAA32 signal line.
From what <br>
I can find, similar discussions have happened around the
Raspberry Pi <br>
platform and as of 2019 there was no way to configure direct
boot to <br>
AArch32.<br>
<br>
Two viable options:<br>
<br>
Write a piece of shim code to drop from EL1 to 32-bit mode
based on the <br>
ARMv8 bare metal boot code (what you need is there, almost
verbatim).<br>
<br>
Recompile QEMU to get the functionality you want (the relevant
code is <br>
in hw/arm/boot.c, look for EM_AARCH64).<br>
<br>
<br>
Kinsey<br>
<br>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank" moz-do-not-send="true">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank" moz-do-not-send="true">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</blockquote>
</div>
</blockquote>
</body>
</html>