[prev in list] [next in list] [prev in thread] [next in thread] 

List:       qemu-discuss
Subject:    Re: [qemu-system-aarch64] dtb flag for aarch64 Linux kernel
From:       Oleksii Kurochko <oleksii.kurochko () gmail ! com>
Date:       2019-10-13 6:45:48
Message-ID: CAMacjJwN8aKQph1_dtsP02dEmq9dvwrmUKU1fLiT-nR3X4LH4g () mail ! gmail ! com
[Download RAW message or body]

Hello Peter,

Thanks for your reply.

Hmm. In theory that's supposed to work, but it's a bit of
> an odd thing to do -- generally you just let the virt
> board autogenerate the DTB and you don't need to use
> the -dtb option at all. (If you do this it's important
> that the options you pass to the qemu binary when you
> do the dumpdtb exactly match the ones you use when you
> later use the virt.dtb, but it seems like you're doing that.)
>

I agree that it is a bit of an odd thing to do, but I need the DTB
for the Linux kernel which is loaded by my custom
bootloader, so  I decided to dump the DTB using the dumpdtb
Qemu option and then concatenate it with the kernel.

In general, it looks like that the dumpdtb option dump incorrect
the DTB file. Because when I saved the pointer to the DTB in my
bootloader, it is in x0 register if I am right, and pass it to the
Linux kernel then all is working fine. So for some reason dtb
that is already in memory differs from that generated by
the dumpdtb option.

Thanks.

Best regards,
 Oleksii

сб, 12 окт. 2019 г. в 22:20, Peter Maydell <peter.maydell@linaro.org>:

> On Sat, 12 Oct 2019 at 13:30, Oleksii Kurochko
> <oleksii.kurochko@gmail.com> wrote:
> > First I successfully booted it without dtb flag in the next way:
> > qemu-system-aarch64 -M virt -cpu cortex-a57 -nographic -m 2048 -kernel
> kernel/arch/arm64/boot/Image -append "console=ttyAMA0"
>
> Yes, this is the expected way to use the 'virt' board.
>
> > After that I decided to dump dtb that is generated inside Qemu:
> > qemu-system-aarch64 -M virt,dumpdtb=virt.dtb -cpu cortex-a57 -nographic
> -m 2048 -kernel kernel/arch/arm64/boot/Image -append "console=ttyAMA0"
> >
> > Finally I tried to boot it with dumped dtb:
> > qemu-system-aarch64 -M virt -cpu cortex-a57 -nographic -m 2048 -kernel
> kernel/arch/arm64/boot/Image -append "console=ttyAMA0
> > " -dtb virt.dtb
> > But I did not see any messages.
>
> Hmm. In theory that's supposed to work, but it's a bit of
> an odd thing to do -- generally you just let the virt
> board autogenerate the DTB and you don't need to use
> the -dtb option at all. (If you do this it's important
> that the options you pass to the qemu binary when you
> do the dumpdtb exactly match the ones you use when you
> later use the virt.dtb, but it seems like you're doing that.)
>
> thanks
> -- PMM
>

[Attachment #3 (text/html)]

<div dir="ltr"><div>Hello Peter,</div><div><br></div><div>Thanks for your \
reply.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Hmm. In theory \
that&#39;s supposed to work, but it&#39;s a bit of<br>an odd thing to do -- generally \
you just let the virt<br>board autogenerate the DTB and you don&#39;t need to \
use<br>the -dtb option at all. (If you do this it&#39;s important<br>that the options \
you pass to the qemu binary when you<br>do the dumpdtb exactly match the ones you use \
when you<br>later use the virt.dtb, but it seems like you&#39;re doing that.)<br> \
</div></blockquote><div><br></div><div>I agree that it is a bit of an odd thing to \
do, but I need the DTB <br></div><div>for the Linux kernel which is loaded by my \
custom <br></div><div>bootloader, so   I decided to dump the DTB using the \
dumpdtb</div><div>Qemu option and then concatenate it with the \
kernel.</div><div><br></div><div>In general, it looks like that the dumpdtb option \
dump incorrect</div><div>the DTB file. Because when I saved the pointer to the DTB in \
my</div>bootloader, it is in x0 register if I am right, and pass it to the<br>Linux \
kernel then all is working fine. So for some reason dtb<br><div>that is already in \
memory differs from that generated by</div><div>the dumpdtb \
option.<br></div><br><div>Thanks.</div><div><br></div><div>Best regards,</div><div>  \
Oleksii<br> </div></div><br><div class="gmail_quote"><div dir="ltr" \
class="gmail_attr">сб, 12 окт. 2019 г. в 22:20, Peter Maydell &lt;<a \
href="mailto:peter.maydell@linaro.org">peter.maydell@linaro.org</a>&gt;:<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 Sat, 12 Oct 2019 at 13:30, Oleksii Kurochko<br> \
&lt;<a href="mailto:oleksii.kurochko@gmail.com" \
target="_blank">oleksii.kurochko@gmail.com</a>&gt; wrote:<br> &gt; First I \
successfully booted it without dtb flag in the next way:<br> &gt; qemu-system-aarch64 \
-M virt -cpu cortex-a57 -nographic -m 2048 -kernel kernel/arch/arm64/boot/Image \
-append &quot;console=ttyAMA0&quot;<br> <br>
Yes, this is the expected way to use the &#39;virt&#39; board.<br>
<br>
&gt; After that I decided to dump dtb that is generated inside Qemu:<br>
&gt; qemu-system-aarch64 -M virt,dumpdtb=virt.dtb -cpu cortex-a57 -nographic -m 2048 \
-kernel kernel/arch/arm64/boot/Image -append &quot;console=ttyAMA0&quot;<br> &gt;<br>
&gt; Finally I tried to boot it with dumped dtb:<br>
&gt; qemu-system-aarch64 -M virt -cpu cortex-a57 -nographic -m 2048 -kernel \
kernel/arch/arm64/boot/Image -append &quot;console=ttyAMA0<br> &gt; &quot; -dtb \
virt.dtb<br> &gt; But I did not see any messages.<br>
<br>
Hmm. In theory that&#39;s supposed to work, but it&#39;s a bit of<br>
an odd thing to do -- generally you just let the virt<br>
board autogenerate the DTB and you don&#39;t need to use<br>
the -dtb option at all. (If you do this it&#39;s important<br>
that the options you pass to the qemu binary when you<br>
do the dumpdtb exactly match the ones you use when you<br>
later use the virt.dtb, but it seems like you&#39;re doing that.)<br>
<br>
thanks<br>
-- PMM<br>
</blockquote></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic